float x
The x coordinate of the vector.

float y
The y coordinate of the vector.

vec2 set(float x, float y)
Sets the value of this vector.

float length()
Returns the length of the vector.

float normalize()
Normalizes the vector (changes the value of this vector).

vec2 normalized()
Returns a vector representing this vector normalized (does not change the value of this vector).

float distanceTo(vec2)
Returns the distance between this vector and the given vector.

vec2 projectOnto(vec2)
Projects this vector onto the given vector (changes the value of this vector).

vec2 projectedOnto(vec2)
Returns a vector representing this vector projected onto the given vector (does not change the value of this vector).

float dot(vec2)
Returns the dot product of this vector with the given vector.

float cross(vec2)
Returns the cross product of this vector with the given vector.