Aimsun Next Scripting
22
|
Public Member Functions | |
GKVector () | |
GKVector (const GKPoint &pini, const GKPoint &pfin) | |
GKVector (const GKCoord ax, const GKCoord ay, const GKCoord az=0.0) | |
virtual | ~GKVector () |
void | set (const GKPoint &pini, const GKPoint &pfin) |
void | set (GKCoord ax, GKCoord ay, GKCoord az=0.0) |
void | setX (GKCoord _x) |
void | setY (GKCoord _y) |
void | setZ (GKCoord _z) |
GKCoord | getX () const |
GKCoord | getY () const |
GKCoord | getZ () const |
double | getLength () const |
void | normalize () |
GKVector | crossProduct (const GKVector &v2) const |
double | dotProduct (const GKVector &v2) const |
GKVector & | operator*= (double d) |
GKVector | operator* (double d) const |
GKVector | operator+ (const GKVector &_vector) const |
GKVector | operator- (const GKVector &_vector) const |
GKVector | operator+ (const GKPoint &_point) const |
GKVector | operator- (const GKPoint &_point) const |
double | angle (const GKVector &v2) const |
double | fullAngle (const GKVector &v2) const |
double | angleWithTheHorizontal () const |
void | rotate (const GKPoint ¢er, float angle) |
Calculation methods for a vector.
GKVector::GKVector | ( | ) |
Constructs a 3D vector using an initial and end points that will be used to calculate its coordinates.
GKVector::GKVector | ( | const GKCoord | ax, |
const GKCoord | ay, | ||
const GKCoord | az = 0.0 |
||
) |
Constructs a 3D vector setting the x, y and z coordinates.
|
virtual |
double GKVector::angle | ( | const GKVector & | v2 | ) | const |
It returns the smallest angle between "this" and "v2" vectors in radians
double GKVector::angleWithTheHorizontal | ( | ) | const |
It returns the angle this vector makes with the horizontal in radians between - GKPI and GKPI. Note: The horizontal is interpreted as the vector (1.0, 0.0)
Returns the resulting vector of calculating the vectorial product between this vector and v2
double GKVector::dotProduct | ( | const GKVector & | v2 | ) | const |
Returns the scalar product between to vectors
double GKVector::fullAngle | ( | const GKVector & | v2 | ) | const |
It returns the angle between "this" and "v2" vectors in radians (0 - 2PI)
double GKVector::getLength | ( | ) | const |
Gets the vector length calculated using the points or coordinates defined for the vector.
GKCoord GKVector::getX | ( | ) | const |
Gets the x coordinate of this vector.
GKCoord GKVector::getY | ( | ) | const |
Gets the y coordinate of this vector.
GKCoord GKVector::getZ | ( | ) | const |
Gets the z coordinate of this vector.
void GKVector::normalize | ( | ) |
Normalizes this vector changing its length to 1.0 meter and normalizing the x,y and z coordinates
GKVector GKVector::operator* | ( | double | d | ) | const |
GKVector & GKVector::operator*= | ( | double | d | ) |
void GKVector::rotate | ( | const GKPoint & | center, |
float | angle | ||
) |
Rotates the vector an angle 'angle' in radians taking 'center' as the center of rotation
Sets the origin and destination point of this vector, used to indicate the vector's direction.
void GKVector::set | ( | GKCoord | ax, |
GKCoord | ay, | ||
GKCoord | az = 0.0 |
||
) |
Sets the x, y and z coordinates of this vector.
void GKVector::setX | ( | GKCoord | _x | ) |
Sets the x coordinate of this vector
void GKVector::setY | ( | GKCoord | _y | ) |
Sets the y coordinate of this vector
void GKVector::setZ | ( | GKCoord | _z | ) |
Sets the z coordinate of this vector