Hilfe für LibreOfficeDev 7.4
Bestimmt den Tangens eines Winkels. Der Winkel wird im Bogenmaß angegeben.
Using the angle Alpha, the Tan function calculates the ratio of the length of the side opposite the angle to the length of the side adjacent to the angle in a right-angled triangle.
Tan(Alpha) = side opposite the angle/side adjacent to angle
Tan (Number As Double) As Double
Double
Zahl: Ein beliebiger numerischer Ausdruck, dessen Tangens (im Bogenmaß) Sie berechnen möchten.
To convert degrees to radians, multiply by Pi/180. To convert radians to degrees, multiply by 180/Pi.
degrees=(radians*180)/Pi
radians=(degrees*Pi)/180
Pi is approximately 3.141593.
' Das folgende Beispielprogramm erlaubt für ein rechtwinkliges Dreieck die Eingabe von:
' Gegenkathete und Winkel (in Grad) und berechnet daraus die Länge der Ankathete:
Sub ExampleTangens
' 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 Ankathete beträgt"; (d1 / tan (dAlpha * Pi / 180))
End Sub