Tan函数

用于返回已指定数值的正切值。

格式
Tan (角度)

参数

角度
指定表示角度的实值。

返回值
以数值返回表示指定角度的数值的正切值。

说明
Tan用于返回正切值。参数单位必须为弧度。

要将角度转换为弧度时,需要使用DegToRad函数。

参阅
Abs, Atan, Atan2, Cos, Int, Mod, Not, Sgn, Sin, Sqr, Str$, Val

Tan函数使用示例

Function tantest
    Real num
    Print "Enter number in radians to calculate tangent for:"
    Input num
    Print "The tangent of ", num, "is ", Tan(num)
Fend

如下所示为通过命令窗口使用Tan函数的示例。

> print tan(0)
0.00
> print tan(degtorad(45))
1
>