2-dimensional Vector object
Adds two vectors together by adding their respective components
Calculates the angle (in radians) between two provided vectors
Calculates the distance between two provided vectors by calculating the effective hypotenuse between them
Calculates the squared distance between two provided vectors by calculating the effective hypotenuse between them
Calculates the dot product of two provided vectors, which is a value representing the similarity of the two
Unit vector (0, 1)
Unit vector (-1, 1)
Unit vector (1, 1)
Hashes a given vector's coordinates using a negative-integer friendly version of the Szudzik pairing function
Unit vector (-1, 0)
Calculates the magnitude of the vector provided by calculating its effective hypotenuse
Calculates the squared magnitude of the vector provided by calculating its effective hypotenuse
Calculates a linear interpolation between two vectors based on some "transition point" t
. Will clamp the value of t
to [0, 1]
Calculates a linear interpolation between two vectors based on some "transition point" t
Calculates the equivalent of a vector whose magnitude is 1
Calculates the projection of one normalized vector against another
Calculates the reflection of one normalized vector against an axis
Unit vector (1, 1)
Unit vector (0, 0)
Calculates a perpendicular vector. Equivalent to the vector rotated 90 degrees counter-clockwise
Calculates the projection of one vector against another
Calculates the reflection of one vector against an axis
Calculates the reverse of a vector. Equivalent to the vector rotated 180 degrees counter-clockwise
Unit vector (1, 0)
Calculates the rotation of a vector by a given angle (in radians)
Calculates the scaled version of a vector
Subtracts two vectors together by subtracting their respective components
Unit vector (0, -1)
Unit vector (-1, -1)
Unit vector (1, -1)
Create a new vector set with values of [0, 0]
Unit vector (0, 0)
2D vector math utilities
Author
studioKeywi