atan() : Arctangent (Inverse Tangent)
On this page
Summary
Calculate the arctangent (inverse tangent) of a value, returning the angle in radians.
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
Output:
<p>atan(1) = 0.785 radians</p>
<p>atan(1) = 45.0°</p>
Find Angle from Slope
Data:
doc.Params["model"] = new {
rise = 5.77,
run = 10
};
Output:
<p>Angle: 30.0°</p>
Calculate Bearing
Notes
- Accepts any numeric value
- Returns angle in radians
- Result range: -π/2 to π/2
- Inverse of
tan()function - For degrees, use:
degrees(atan(value))