Axuda do Collabora Office 24.04
Función trigonométrica que devolve o arco tanxente dunha expresión numérica. O valor de retorno está no intervalo de -Pi/2 a +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).
Para converter radiáns en graos, multiplique os radiáns por 180/pi.
grao=(radián*180)/pi
radián=(grao*pi)/180
Pi is here the fixed circle constant with the rounded value 3.14159. Pi is a Basic mathematical constant.
REM O seguinte exemplo calcula para un triángulo rectángulo,
REM o ángulo Alfa a partir da tanxente do ángulo Alfa:
Sub ExampleAtn
REM Pi = 3,14159 arredondado é unha constante predefinida
Dim d1 As Double
Dim d2 As Double
d1 = InputBox("Introduza a lonxitude do lado adxacente ao ángulo: ","Adxacente")
d2 = InputBox("Introduza a lonxitude do lado oposto ao ángulo: ","Oposto")
Print "O ángulo Alfa é"; (atn (d2/d1) * 180 / Pi); " graos"
End Sub