Vec2:angle

Edit

Returns the angle between vectors.



Arguments

NameTypeDescription
uVec2 The other vector.

Returns

NameTypeDescription
anglenumber The angle to the other vector, in radians.

Arguments

NameTypeDescription
xnumber The x component of the other vector.
ynumber The y component of the other vector.

Returns

NameTypeDescription
anglenumber The angle to the other vector, in radians.

Notes

If any of the two vectors have a length of zero, the angle between them is not well defined. In this case the function returns math.pi / 2.

See also