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
>