Skip to main content

Mathf.Atan2(number y, number x)

Returns the angle in radians whose Tan is y/x.

Parameters:

NameTypeDescription
ynumbery
xnumberx

Returns:

typeDescription
numberThe angle between the x-axis and a 2D vector starting at zero and terminating at (x,y).

Usage

---@type number
local y;

---@type number
local x;


local val0 = Mathf:Atan2(y, x)