(getter/setter) The angle of the vector, in radians
(getter/setter) The angle of the vector, in radians
(getter) Vector area.
(getter) Returns the basic array representation of this vector.
(getter/setter) Vector height. Alias of Vector#x x
(getter/setter) The length of the vector
(getter/setter) The length of the vector presented as a square. If you're using length for comparison, this is quicker.
(getter/setter) Vector slope.
(getter/setter) Vector width. Alias of Vector#x x
(getter/sette) Swizzle XX
(getter/sette) Swizzle YX
(getter/sette) Swizzle YY
Calculates the cross product between this and the supplied vector.
The vector object against which to calculate the cross product
The cross product of the two vectors
Calculates the distance between this and the supplied vector
The vector to calculate the distance from
The distance between this and the supplied vector
Calculates the distance on the X axis between this and the supplied vector
The vector to calculate the distance from
The distance, along the x axis, between this and the supplied vector
Calculated the distance on the Y axis between this and the supplied vector
The vector to calculate the distance from
The distance, along the y axis, between this and the supplied vector
Calculates the dot product between this and a supplied vectorT
The vector object against which to calculate the dot product
The dot product of the two vectors
Static
getStatic
interpolateStatic
lerp
A basic 2D Vector class that provides simple algebraic functionality in the form of 2D Vectors.
We use Getters/setters for both principle properties (x & y) as well as virtual properties (rotation, length etc.).
Vec2
Author
Liam Egan liam@wethecollective.com
Version
1.0.0
Created
Jan 07, 2020