ImmutableVector2
Represent an immutable vector 2D
You may use ImmutableVector2.toMutable to create a (mutable) Vector2 from a an ImmutableVector2. And an ImmutableVector2 can be created from a Vector2 with Vector2.toImmutable.
Properties
Functions
Returns the angle in degrees of this vector relative to the reference. Angles are towards the positive y-axis (typically counter-clockwise.) between -180 and +180
Returns the angle in degrees of this vector relative to the reference vector described by referenceX and referenceY.
Returns the angle in radians of this vector relative to the reference. Angles are towards the positive y-axis. (typically counter-clockwise)
Returns the angle in radians of this vector relative to the (referenceX, referenceY) reference. Angles are towards the positive y-axis. (typically counter-clockwise)
Calculates the 2D cross product between this and the other vector
Returns a new vector instance with all members decremented by 1
Returns a new vector instance with all members incremented by 1
Returns the result of subtracting the other vector from this vector
Returns the result of adding the other vector to this vector
Apply the given affine transformation and return the resulting vector
Returns a new vector instance scaled by the given scalar
Returns a new vector instance scaled by the given vector
Returns the opposite vector of same length
Returns a vector of same length with the given angle in degree
Returns a vector of same length with the given angle in radians
Returns the result of interpolation between this vector and the given target vector by alpha (within range 0,1) using the given interpolation method.
Returns a vector of same direction and the given length
Returns a vector of the same direction and a squared length of length2
Returns this vector if the ImmutableVector.len is <= limit or a vector with the same direction and length limit otherwise
Returns this vector if the ImmutableVector.len2 is <= limit2 or a vector with the same direction and length limit2 otherwise
Returns a vector of same length and a random direction.
Returns a vector of same length rotated by 90 degrees in the given direction
Returns a vector of same length rotated by the given angle in degree
Returns a vector of same length rotated by the given angle in radians
Calculates the 2D cross product between this and the other vector