2015-02-09 21:43:00 +01:00

983 B

Function tan

Calculate the tangent of a value. tan(x) is equal to sin(x) / cos(x).

For matrices, the function is evaluated element wise.

Syntax

math.tan(x)

Parameters

Parameter Type Description
x Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null Function input

Returns

Type Description
Number | BigNumber | Complex | Array | Matrix Tangent of x

Examples

math.tan(0.5);                    // returns Number 0.5463024898437905
math.sin(0.5) / math.cos(0.5);    // returns Number 0.5463024898437905
math.tan(math.pi / 4);            // returns Number 1
math.tan(math.unit(45, 'deg'));   // returns Number 1

See also

atan, sin, cos