Atn Function

Тригонометрична функция, която връща аркустангенса на стойността на числов израз. Резултатът е между -Pi/2 и +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).

За да преобразувате от радиани към градуси, умножете радианите по 180/π.

degrees = (radians * 180) / Pi

radians = (degrees * Pi) / 180

Pi is here the fixed circle constant with the rounded value 3.14159. Pi is a Basic mathematical constant.

Кодове за грешка:

5 Невалидно извикване на процедура

Пример:


        ' Изчисление за правоъгълен триъгълник
        ' Намираме ъгъла по тангенса му:
        Sub ExampleAtn
        ' Pi е дефинирана константа с приблизителна стойност 3,14159
        Dim d1 As Double
        Dim d2 As Double
            d1 = InputBox("Въведете дължината на прилежащия катет: ", "Прилежащ катет")
            d2 = InputBox("Въведете дължината на срещулежащия катет: ", "Срещулежащ катет")
            Print "Ъгълът е "; (atn(d2 / d1) * 180 / Pi); " градуса"
        End Sub