函数 tan #
计算值的正切。tan(x) 等于 sin(x) / cos(x)。
为避免与矩阵正切混淆,此函数不适用于矩阵。
Syntax #
math.tan(x)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Complex | Unit | 函数输入 |
Returns #
| Type | Description |
|---|---|
| number | BigNumber | Complex | x 的正切 |
Throws #
Type | Description —- | ———–
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