Tan函數

用於傳回指定數值的正切值。

格式
Tan (角度)

參數

角度
指定表示角度的實數值。

傳回值
用於以數值傳回表示指定角度數值的正切值。

說明
Tan用於傳回正切值。參數單位必須是弧度。

若要將弧度轉換為角度,則使用RadToDeg函數。

參照
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(45)
1.6197751905439
>