Pomoc LibreOffice 7.5
Zwraca sinus kąta. Kąt jest wyrażony w radianach. Wynik mieści się w zakresie od -1 do 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
Sin (Number As Double) As Double
Double
Liczba: Wyrażenie numeryczne określające kąt w radianach, dla którego należy obliczyć sinus.
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.
' Poniższy przykład oblicza długość przyprostokątnej przyległej do kąta:
' na podstawie przyprostokątnej naprzeciw kąta i kąta (w stopniach) w trójkącie prostokątnym:
Sub ExampleSine
' zdefiniowana stała Pi = 3,1415926
Dim d1 As Double
Dim dAlpha As Double
d1 = InputBox("Wprowadź długość przeciwprostokątnej: ","Przeciwprostokątna")
dAlpha = InputBox("Wprowadź kąt Alfa (w stopniach): ","Alfa")
Print "Długość przeciwprostokątnej wynosi"; (d1 / sin (dAlpha * Pi / 180))
End Sub