Skip to content

raylib.Vector2LineAngle

JoeStrout edited this page Nov 16, 2026 · 3 revisions

Calculate the angle (in radians) of the line from start to end, i.e. -atan(end.y - start.y, end.x - start.x)

Parameters

Parameter Default Value Note
start [0, 0]
end [0, 0]

Return value

Condition Return Value
(always) number

Notes

Example

startPt = [0, 0]
endPt = [1, 0]
angle = raylib.Vector2LineAngle(startPt, endPt)
print angle  // 0 (horizontal line pointing right)

Clone this wiki locally