Atn Function

Trigonometric function that returns the arctangent of a numeric expression. The return value is in the range -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

Sintaksis:

Atn (Angka)

Nilai hasil:

Ganda

Parameter:

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

Untuk mengonversi radian ke derajat, kalikan radian dengan 180/pi.

degree=(radian*180)/pi

radian=(degree*pi)/180

Pi di sini adalah konstanta lingkaran tetap dengan nilai 3.14159.

Kode kesalahan:

5 Tidak sah dalam pemanggilan prosedur

Contoh:

' Contoh berikut untuk menghitung segitiga siku-siku

' sudut Alpha dari garis singgung sudut Alpha:

Sub ExampleAtn

' bulatan Pi = 3.14159 adalah konstanta yang ditentukan sebelumnya

Dim d1 As Double

Dim d2 As Double

    d1 = InputBox("Masukkan panjang sisi yang berdekatan dengan sudut: ","Berdekatan")

    d2 = InputBox("Masukkan panjang sisi yang berseberangan dengan sudut: ","Seberang")

    Cetak "Sudut alfa adalah"; (atn (d2 / d1) * 180 / Pi); "derajat"

End Sub