Aimsun Next Scripting  22
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GKPoint Class Reference

Public Member Functions

 GKPoint ()
 
 GKPoint (const GKCoord, const GKCoord, const GKCoord=0)
 
bool almostDifferents (const GKPoint &, GKCoord) const
 
bool areEqual (const GKPoint &, double) const
 
bool areEqual2D (const GKPoint &, double) const
 
double distance2D (const GKPoint &) const
 
double distance3D (const GKPoint &) const
 
void set (GKCoord, GKCoord, GKCoord=0.0)
 
GKCoord getAngleHorizontalInDegs (const GKPoint &) const
 
GKCoord getAngleHorizontalInRads (const GKPoint &) const
 
double getMinAngleHorizontalInRads (const GKPoint &) const
 
double getMinAngleVerticalInRads (const GKPoint &) const
 
GKPoint rotate2D (const GKPoint &, double) const
 
void rotate2DThis (const GKPoint &, double)
 
GKPoint lerp (const GKPoint &, double) const
 
bool betweenPoints (const GKPoint &, const GKPoint &, double) const
 
bool pointAtDistance (const GKPoint, const double, GKPoint &) const
 

Public Attributes

GKCoord x
 
GKCoord y
 
GKCoord z
 

Static Public Attributes

static GKPoint zero
 

Detailed Description

This 3d point can contain the (x, y, z) coordinates of a point. It can be used to contain a 2d point as most of the methods have a default z value assigned to 0. For a point in degrees, it must be defined as GKPoint( latitude, longitude ).

Constructor & Destructor Documentation

◆ GKPoint() [1/2]

GKPoint::GKPoint ( )

◆ GKPoint() [2/2]

GKPoint::GKPoint ( const  GKCoord,
const  GKCoord,
const  GKCoord = 0 
)

Member Function Documentation

◆ almostDifferents()

bool GKPoint::almostDifferents ( const GKPoint ,
GKCoord   
) const

Returns true if "this" point is different from "c" (first parameter) after multiplying the coordinates by a factor (second parameter) and comparing each one as integers

◆ areEqual()

bool GKPoint::areEqual ( const GKPoint ,
double   
) const

Returns true if both points are close enough taking into account the epsilon (in m) provided as second parameter. All x, y, and z are taken into account.

◆ areEqual2D()

bool GKPoint::areEqual2D ( const GKPoint ,
double   
) const

Returns true if both points are close enough taking into account the epsilon (in m) provided as second parameter. Only the 2D coordinates of the points (x and y) are taken into account

◆ betweenPoints()

bool GKPoint::betweenPoints ( const GKPoint ,
const GKPoint ,
double   
) const

Supposing that all three points pertain to the same line, returns true if this is located between p1 and p2; false otherwise. The epsilon is the distance in m allowed for distorsion

◆ distance2D()

double GKPoint::distance2D ( const GKPoint ) const

Distance between "this" point and point "c" without using the Z coordinate.

◆ distance3D()

double GKPoint::distance3D ( const GKPoint ) const

Distance between "this" point and point "c" taking into account x, y and z coordinates.

◆ getAngleHorizontalInDegs()

GKCoord GKPoint::getAngleHorizontalInDegs ( const GKPoint ) const

Returns the angle that the segment defined by this point and "point" makes with the horitzontal. Between GKPI and -GKPI

◆ getAngleHorizontalInRads()

GKCoord GKPoint::getAngleHorizontalInRads ( const GKPoint ) const

Returns the angle that the segment defined by this point and "point" makes with the horitzontal. Between GKPI and -GKPI

◆ getMinAngleHorizontalInRads()

double GKPoint::getMinAngleHorizontalInRads ( const GKPoint ) const

Returns the angle that the line defined by this point and "point" makes with the horitzontal. Between GKPI/2 and -GKPI/2

◆ getMinAngleVerticalInRads()

double GKPoint::getMinAngleVerticalInRads ( const GKPoint ) const

Returns the angle that the line defined by this point and "point" makes with the vertical. Between GKPI/2 and -GKPI/2

◆ lerp()

GKPoint GKPoint::lerp ( const GKPoint ,
double   
) const

Lerp: returns (1-f)this + pf.

◆ pointAtDistance()

bool GKPoint::pointAtDistance ( const  GKPoint,
const double  ,
GKPoint  
) const

Sets the point 'res' that is on the line that goes to point 'p' at distance 'd' If the value returnen is 'false' then an error occourred and 'res' is not set

◆ rotate2D()

GKPoint GKPoint::rotate2D ( const GKPoint ,
double   
) const

Rotates this point, given a center and an angle in radians. The rotated point is returned and this one is not modified

◆ rotate2DThis()

void GKPoint::rotate2DThis ( const GKPoint ,
double   
)

Rotates this point, given a center and an angle in radians, modifying it.

◆ set()

void GKPoint::set ( GKCoord  ,
GKCoord  ,
GKCoord  = 0.0 
)

Sets the (x, y, z) coordinates of the point.

Member Data Documentation

◆ x

GKCoord GKPoint::x

x coordinate of the point

◆ y

GKCoord GKPoint::y

y coordinate of the point

◆ z

GKCoord GKPoint::z

z coordinate of the point

◆ zero

GKPoint GKPoint::zero
static

Point at (0, 0, 0)

© Aimsun SLU
Aimsun ®