Skip to content

Api > Vector3 > SignedAngle()


Vector3.SignedAngle(Vector3 from, Vector3 to, Vector3 axis)⚓︎

Returns the signed angle in degrees between from and to.

Parameters:⚓︎

Name Type Description
from Vector3 The vector from which the angular difference is measured.
to Vector3 The vector to which the angular difference is measured.
axis Vector3 A vector around which the other vectors are rotated.

Returns:⚓︎

type Description
number the signed angle in degrees between from and to.

Usage⚓︎

---@type Vector3
local from;

---@type Vector3
local to;

---@type Vector3
local axis;


local val0 = Vector3:SignedAngle(from, to, axis)

Extra Detail⚓︎

The smaller of the two possible angles between the two vectors is returned, therefore the result will never be greater than 180 degrees or smaller than -180 degrees. If you imagine the from and to vectors as lines on a piece of paper, both originating from the same point, then the axis vector would point up out of the paper. The measured angle between the two vectors would be positive in a clockwise direction and negative in an anti-clockwise direction.