Quirrel4.41.0

math.atan

Defined in module "math"
from "math" import atan
pure fastcall atan(x: number): float

Returns the arctangent of x

Parameters

xnumbervalue whose arctangent is wanted

Return value

The arctangent of x, in the range [-PI/2, PI/2], always as a float.

Notes

Unlike asin and acos, x is defined for every real number, so there is no domain to clamp.

Example

examples/math/atan.nut
from "math" import atan

println("atan(0) =", atan(0))
println("atan(1) =", atan(1))
println("atan(-1) =", atan(-1))

// unlike asin/acos, atan has no restricted domain
println("type(atan(1)) =", type(atan(1)))
Output:
atan(0) = 0
atan(1) = 0.785398
atan(-1) = -0.785398
type(atan(1)) = float

See also

atan2Returns the arctangent of y/x using the signs to determine the quadrant
asinReturns the arcsine of x
acosReturns the arccosine of x
PIThe ratio of a circle's circumference to its diameter, for converting between radians and degrees and for angle math in general.
mathmodule index