Get the angle between two 2D vectors
The first operand
The second operand
The angle in radians
Creates a new vec2 initialized with values from an existing vector
vector to clone
a new 2D vector
Creates a new, empty vec2
a new 2D vector
Calculates the euclidian distance between two vec2's
the first operand
the second operand
distance between a and b
Calculates the euclidian distance between two vec2's
the first operand
the second operand
distance between a and b
Calculates the dot product of two vec2's
the first operand
the second operand
dot product of a and b
Returns whether or not the vectors have approximately the same elements in the same position.
The first vector.
The second vector.
True if the vectors are equal, false otherwise.
Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)
The first vector.
The second vector.
True if the vectors are equal, false otherwise.
Creates a new vec2 initialized with the given values
X component
Y component
a new 2D vector
Calculates the length of a vec2
vector to calculate length of
length of a
Calculates the length of a vec2
vector to calculate length of
length of a
Calculates the squared euclidian distance between two vec2's
the first operand
the second operand
squared distance between a and b
Calculates the squared length of a vec2
vector to calculate squared length of
squared length of a
Calculates the squared euclidian distance between two vec2's
the first operand
the second operand
squared distance between a and b
Calculates the squared length of a vec2
vector to calculate squared length of
squared length of a
Returns a string representation of a vector
vector to represent as a string
string representation of the vector
Adds two vec2's