Aimsun Next Scripting
22
|
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 |
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 ).
GKPoint::GKPoint | ( | ) |
GKPoint::GKPoint | ( | const | GKCoord, |
const | GKCoord, | ||
const | GKCoord = 0 |
||
) |
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
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.
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
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
double GKPoint::distance2D | ( | const GKPoint & | ) | const |
Distance between "this" point and point "c" without using the Z coordinate.
double GKPoint::distance3D | ( | const GKPoint & | ) | const |
Distance between "this" point and point "c" taking into account x, y and z coordinates.
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
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
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
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
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
Rotates this point, given a center and an angle in radians. The rotated point is returned and this one is not modified
void GKPoint::rotate2DThis | ( | const GKPoint & | , |
double | |||
) |
Rotates this point, given a center and an angle in radians, modifying it.
void GKPoint::set | ( | GKCoord | , |
GKCoord | , | ||
GKCoord | = 0.0 |
||
) |
Sets the (x, y, z) coordinates of the point.
GKCoord GKPoint::x |
x coordinate of the point
GKCoord GKPoint::y |
y coordinate of the point
GKCoord GKPoint::z |
z coordinate of the point
|
static |
Point at (0, 0, 0)