Returns the arccosine of a number, an angle in radians whose cosine is that number.
math.acos is the inverse of math.cos. It accepts values from -1 to 1 and returns an angle from 0 to math.pi.
A value outside -1 to 1 has no angle, and the result is na.
Syntax
math.acos(angle: simple int/float) -> simple float
math.acos(angle: input int/float) -> input float
math.acos(angle: const int/float) -> const float
math.acos(angle: series int/float) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| angle | const/ | required | A value from -1 to 1. Anything outside that range gives na. |
Returns
const/input/simple/series float: the angle in radians.
Remarks
math.acos(1)is 0 andmath.acos(-1)ismath.pi.
Example
//@version=6
indicator("Arccosine")
x = ta.stoch(close, high, low, 14) / 50 - 1
plot(math.todegrees(math.acos(x)), "Angle (degrees)", color = color.orange)See also
Runs on Sidechair