Lotus Symphony 1.2
|
確定一個角度的正弦值。角度以弧度為單位指定。結果在 -1 到 1 之間。
以 Alpha 角為例,在直角三角形中 Sin 函數計算 Alpha 的對邊與斜邊長度之比。
Sin(Alpha) = 對邊/斜邊
Number:數值表示式,用於定義要計算正弦值的角度 (以弧度為單位)。
若要將度轉換成弧度,可將度乘以 pi/180;若要將弧度轉換成度,則將弧度乘以 180/pi。
度 = (弧度*180) /pi
弧度 = (度*pi)/180
Pi 的近似值是 3.141593。
REM 在此範例中,以下項目均可用於直角三角形:
REM 角的對邊和角度 (以度為單位),並計算斜邊長度:
Sub ExampleSine
REM Pi = 3.1415926 是預先定義的變數
Dim d1 as Double
Dim dAlpha as Double
d1 = InputBox$ ("Enter the length of the opposite side: ","Opposite Side")
dAlpha = InputBox$ ("Enter the angle Alpha (in degrees): ","Alpha")
Print "The length of the hypotenuse is"; (d1 / sin (dAlpha * Pi / 180))
End Sub