Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)

atan() : Arctangent (Inverse Tangent)

Calculate the arctangent (inverse tangent) of a value, returning the angle in radians.


On this page

Signature

atan(value)

Parameters

Parameter Type Required Description
value Number Yes The tangent value

Returns

Type: Double

The angle in radians (between -π/2 and π/2).


Examples

Basic Arctangent

<p>atan(1) = {{format(atan(1), '0.000')}} radians</p>
<p>atan(1) = {{format(degrees(atan(1)), '0.0')}}°</p>

Output:

<p>atan(1) = 0.785 radians</p>
<p>atan(1) = 45.0°</p>

Find Angle from Slope

<p>Angle: {{format(degrees(atan(model.rise / model.run)), '0.0')}}°</p>

Data:

doc.Params["model"] = new {
    rise = 5.77,
    run = 10
};

Output:

<p>Angle: 30.0°</p>

Calculate Bearing

<p>Bearing: {{format(degrees(atan(model.opposite / model.adjacent)), '0.1')}}°</p>

Notes

  • Accepts any numeric value
  • Returns angle in radians
  • Result range: -Ï€/2 to Ï€/2
  • Inverse of tan() function
  • For degrees, use: degrees(atan(value))

See Also