Guida di LibreOffice 7.3
Restituisce il seno di un angolo. L'angolo viene specificato in radianti. Il risultato è compreso tra -1 e 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
Numero: espressione numerica che definisce, in radianti, l'angolo di cui si desidera calcolare il seno.
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.
' In questo esempio, per un triangolo retto è possibile immettere:
' Il lato opposto all'angolo e l'angolo (in gradi) per calcolare la lunghezza dell'ipotenusa:
Sub ExampleSine
' Pi = 3,1415926 è una variabile predefinita
Dim d1 As Double
Dim dAlpha As Double
d1 = InputBox("Inserite la lunghezza del lato opposto: ","Lato opposto")
dAlpha = InputBox("Inserite l'angolo Alfa (in gradi): ","Alfa")
Print "La lunghezza dell'ipotenusa è"; (d1 / sin (dAlpha * Pi / 180))
End Sub