math.tan()

类型 函数
math.*
返回值 数字
修订 版本 2024.3703
关键词 tan,正切
另请参阅 math.atan()
math.atan2()

概述

返回 x(以弧度为单位的角度)的正切值。

语法

math.tan( x )
x (必填)

数字。以弧度为单位的角度。

示例

print(math.tan(-math.pi/2))   ---> a very large negative number
print(math.tan(math.pi/4))    ---> 1
print(math.tan(math.pi/2))    ---> a very large number