Skip to main content

acos

Function acos 

Source
pub fn acos(x: number) -> number
Expand description

Returns the arc cosine of a number, in radians.

§Parameters

  • x: a number in the range [−1, 1].

§Return value

The arc cosine of x, in radians, as a float in the range [0, π]. Arguments outside [−1, 1] produce NaN.

§Examples

print(math.acos(1))     --> 0.0
print(math.acos(0))     --> 1.5707963267948966
print(math.acos(-1))    --> 3.141592653589793

§See also

asin, atan, cos