Ajuda del Collabora Office 24.04
Funció trigonomètrica que torna l'arc tangent d'una expressió numèrica. El valor de retorn es troba a l'interval entre -Pi/2 i +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).
Per a convertir radians en graus, multipliqueu els radians per 180/pi.
grau=(radian*180)/pi
radian=(grau*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159. Pi is a Basic mathematical constant.
' L'exemple següent calcula un triangle rectangle
' l'angle Alpha de la tangent de l'angle Alpha:
Sub ExampleAtn
' Pi arrodonit = 3,14159 és una constant predefinida
Dim d1 As Double
Dim d2 As Double
d1 = InputBox("Introduïu la longitud del costat adjacent a l'angle: ","Adjacent")
d2 = InputBox("Introduïu la longitud del costat oposat de l'angle: ","Oposat")
Print "L'angle Alpha fa"; (atn (d2/d1) * 180 / Pi); " graus"
End Sub