Sin Function

Ermittelt den Sinus eines Winkels. Der Winkel wird im Bogenmaß angegeben. Das Ergebnis liegt im Bereich von -1 bis 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

Rückgabewert:

Double

Parameter:

Zahl: Numerischer Ausdruck, der einen im Bogenmaß (Rad) angegebenen Winkel darstellt, dessen Sinus Sie berechnen möchten.

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.

Fehlercodes:

5 Ungültiger Prozeduraufruf

Beispiel:


' Das folgende Beispielprogramm erlaubt für ein rechtwinkliges Dreieck die Eingabe von:
' Gegenkathete und Winkel (in Grad) und berechnet daraus die Länge der Hypotenuse:
Sub ExampleSine
' Pi = 3.1415926 ist eine vordefinierte Variable
Dim d1 As Double
Dim dAlpha As Double
    d1 = InputBox("Bitte geben Sie die Länge der Gegenkathete ein: ","Gegenkathete")
    dAlpha = InputBox("Bitte geben Sie den Winkel Alpha ein (in Grad): ","Alpha")
    Print "Die Länge der Hypotenuse beträgt"; (d1 / sin (dAlpha * Pi / 180))
End Sub