LibreOffice 7.4 Help
Funkcja trygonometryczna dająca w wyniku arcus tangens wyrażenia numerycznego. Zwracana wartość mieści się w zakresie od -Pi/2 do +Pi/2.
The arctangent is the inverse of the tangent function. The Atn Function returns the angle "Alpha", expressed in radians, using the tangent of this angle. The function can also return the angle "Alpha" by comparing the ratio of the length of the side that is opposite of the angle to the length of the side that is adjacent to the angle in a right-angled triangle.
Atn(side opposite the angle/side adjacent to angle)= Alpha
Atn (Number As Double) As Double
Double
Number: Any numerical expression that represents the ratio of two sides of a right triangle. The Atn function returns the corresponding angle in radians (arctangent).
Aby przeliczyć radiany na stopnie, należy pomnożyć radiany razy 180/pi.
stopnie=(radiany*180)/pi
radiany=(stopnie*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159. Pi is a Basic mathematical constant.
' Poniższy przykład oblicza kąt alfa trójkąta prostokątnego
' z tangensa tego kąta w trójkącie prostokątnym:
Sub ExampleAtn
' zdefiniowana stała Pi = 3,14159 (w przybliżeniu)
Dim d1 As Double
Dim d2 As Double
d1 = InputBox("Wprowadź długość przyprostokątnej przyległej do kąta: ","Przyprostokątna")
d2 = InputBox("Wprowadź długość przeciwprostokątnej do kąta: ","Przeciwprostokątna")
Print "Kąt Alfa wynosi"; (atn (d2/d1) * 180 / Pi); " stopni"
End Sub