Number.Tan
NumberReturns the tangent of an angle specified in radians.
Syntax
Number.Tan(number as nullable number) as nullable numberParameters
| Name | Type | Required | Description |
|---|---|---|---|
number | number | Yes | The angle in radians. |
Return Value
number — The tangent of the angle in radians.
Remarks
Number.Tan returns the trigonometric tangent of an angle measured in radians. Tangent is defined as sine divided by cosine: tan(x) = sin(x) / cos(x). Power Query M uses radians throughout — convert degrees to radians by multiplying by Number.PI / 180.
The tangent function has asymptotes at odd multiples of π/2 (90°, 270°, etc.), where cosine equals zero. At these points, the result grows toward ±infinity. Due to floating-point arithmetic, computing Number.Tan(Number.PI / 2) returns a very large finite number (approximately 1.633e16) rather than true infinity — because Number.PI itself is only an approximation of π. Be aware of this near-singular behavior when computing tangents of angles close to 90°.
The tangent function is odd (tan(-x) = -tan(x)) and periodic with period π (not 2π like sine and cosine). Number.Tan(0) = 0, Number.Tan(Number.PI / 4) ≈ 1 (exactly 1 at 45°, but subject to floating-point imprecision). For computing angles from a rise/run ratio, use Number.Atan.
Examples
Example 2: Tangent of 45 degrees — should be 1 but has floating-point imprecision
Number.Tan(Number.PI / 4)Result | |
|---|---|
| 1 | 1.00 |