Skip to main content

Vector2.SignedAngle(Vector2 from, Vector2 to)

Returns the signed angle in degrees between from and to.

Parameters:

NameTypeDescription
fromVector2The vector from which the angular difference is measured.
toVector2The vector to which the angular difference is measured.

Returns:

typeDescription
numberthe signed angle in degrees between from and to.

Usage

---@type Vector2
local from;

---@type Vector2
local to;


local val0 = Vector2:SignedAngle(from, to)

Extra Detail

The angle returned is the signed acute clockwise angle between the two vectors. This means the smaller of the two possible angles between the two vectors is used. The result is never greater than 180 degrees or smaller than -180 degrees.