x component of vector
scalar x
y component of vector
scalar y
Initializes zero length vector.
Vector2()
Initialize vector given an x and y component.
void set( scalar nx, scalar ny )
resolve vector, given a magnitude & angle in degrees.
void resolveDeg( scalar magnitude, scalar angle )
resolve vector, given a magnitude & angle in radians.
void resolveRad( scalar magnitude, scalar angle )
Normalizes the vector.
void normalize()
Calculates dot product of two vectors.
scalar dot( const Vector2 & rhs ) const
Get length of vector.
scalar getMagnitude() const
Angle of vector in degrees, angle is calculated with respect to positive X axis.
scalar getAngleDeg() const
Angle of vector in radians, angle is calculated with respect to positive X axis.
scalar getAngleRad() const
Calculate the normal vector.
Vector2 calcNormal() const
Calculates angle between two vectors.
scalar calcInnerAngleRad( const Vector2 & vec ) const
Calculates angle between two vectors.
scalar calcInnerAngleDeg( const Vector2 & vec ) const
Find length of a vector.
scalar magnitude( const Vector2 & v )
Determine distance between two points.
scalar distance( const Vector2 & v1, const Vector2 & v2 )