Skip to content

raylib.Vector2Angle

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Calculate the signed angle from v1 to v2, relative to the origin (0, 0) NOTE: Coordinate system convention: positive X right, positive Y down positive angles appear clockwise, and negative angles appear counterclockwise

Parameters

Parameter Default Value Note
v1 [0, 0]
v2 [0, 0]

Return value

Condition Return Value
(always) number

Notes

Example

v1 = [1, 0]
v2 = [0, 1]
angle = raylib.Vector2Angle(v1, v2)
print angle  // approximately 1.5708 (pi/2 radians)

Clone this wiki locally