atan
This page explains how to use the atan function in APL.
Use the atan function in APL to compute the arc tangent (inverse tangent) of a numeric expression. The function returns the angle, in radians, whose tangent equals the input value. Unlike asin and acos, atan accepts any real number as input.
atan is useful when you want to map a numeric value from an unbounded range to a bounded angular range (-π/2, π/2). For example, you can use atan to normalize latency deviations, scores, or ratios into a smooth angle scale for comparison or encoding.
Usage
Syntax
APL
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
x | real | Yes | A real number. |
Returns
The arc tangent of x in radians, in the range (-π/2, π/2).
Example
Use atan to compute the arctangent of a value and return the angle in radians.
Query
Output
| result |
|---|
| 0.7854 |
List of related functions
- atan2: Returns the arc tangent using two arguments (y, x). Use it when you have separate numerator and denominator values.
- asin: Returns the arc sine. Use it when the input is bounded to [-1, 1].
- acos: Returns the arc cosine. Use it when you need the inverse cosine instead.
- tan: Returns the tangent. Use it to apply the forward transformation before using
atanas the inverse. - radians: Converts degrees to radians. Use it when your angle data is in degrees.