Number.Tan

Number

Returns the tangent of an angle specified in radians.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Number.Tan(number as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
numbernumberYesThe angle in radians.

Return Value

numberThe 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 1: Tangent of 0 radians

Result
Result
10

Example 2: Tangent of 45 degrees — should be 1 but has floating-point imprecision

Result
Result
11.00

Example 3: Tangent of 30 degrees

Number.Tan(30 * Number.PI / 180)
Result
Result
10.58

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks