Sidechair

math.todegrees()

Browse the reference

Converts an angle from radians to degrees.

Try it in the editor

math.todegrees multiplies radians by 180 / pi. Use it to show the result of an inverse trigonometric function in familiar units.

math.pi radians becomes 180 degrees.

Syntax

Pine Script
math.todegrees(radians: series int/float) -> series float

Arguments

NameTypeDefaultDescription
radiansseries int/floatrequiredThe angle in radians to convert. math.pi radians becomes 180 degrees.

Returns

series float: the angle in degrees.

Remarks

Example

Pine ScriptArctangent in degreesOpen in editor
//@version=6
indicator("Atan in degrees")
plot(math.todegrees(math.atan(ta.change(close))), "Angle", color = color.red)

See also

Runs on Sidechair