Atn Function

Trigonometrisk funksjon som returnerer arctangens av eit numerisk uttrykk. Resultatet er i omrÄdet -Pi/2 to +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

Syntaks:


        Atn (Number As Double) As Double
    

Returverdi:

Double

Parametrar:

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).

For Ă„ omforma radianar til grader, multipliser radianar med 180/pi.

grader=(radianar*180)/pi

radian=(grad*pi)/180

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

Feilkodar

5 Ugyldig prosedyreoppkall

Eksempel:


        ' Det neste eksempelet reknar ut for ein rettvinkla trekant
        ' Vinkelen Alpha frÄ tangenten til vinkelen Alpha:
        Sub ExampleAtn
        ' Pi er ein fĂžrehandsdefinert konstant avrunda til 3,14159
        Dim d1 As Double
        Dim d2 As Double
            d1 = InputBox("Skriv inn lengda pÄ den hosliggjande sida til vinkelen: ","TilstÞytande")
            d2 = InputBox("Skriv inn lengda pÄ den motstÄande sida til vinkelen: ","MotstÄande")
            Print "Alpha-vinkelen er"; (atn (d2/d1) * 180 / Pi); " grader"
        End Sub