Sin Function

傳回一個角度的正弦值,角度以弧度為單位指定,結果在 -1 到 1 之間。

Using the angle Alpha, the Sin function returns the ratio of the length of the opposite side of an angle to the length of the hypotenuse in a right-angled triangle.

Sin(Alpha) = side opposite the angle/hypotenuse

Syntax:


Sin (Number As Double) As Double

Return value:

Double

Parameters:

Number:數值型表示式,用於定義要計算正弦值的角度 (以弧度為單位)。

To convert degrees to radians, multiply degrees by Pi/180, and to convert radians to degrees, multiply radians by 180/Pi.

degrees=(radians*180)/Pi

radians=(degrees*Pi)/180

Pi is approximately 3.141593.

錯誤代碼:

5 無效的程序呼叫

Example:


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

Please support us!