Function Reference


ATan

Calculates the arctangent of a number.

ATan ( expression )

Parameters

expression Any valid numeric expression.

Return Value

Returns the trigonometric arctangent of the number. Result is in radians.

Remarks

The result of 4 * ATan(1) is pi.

Related

ACos, ASin, Cos, Sin, Tan

Example

Example 1

#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Assign a Local variable the arcTangent of 0.5.
    Local $fArcTan1 = ATan(0.5)

    ; Display the result.
    MsgBox($MB_SYSTEMMODAL, "", $fArcTan1 & " rad.")

    ; Assign a Local constant variable the approximate PI number.
    Local Const $PI = 3.141592653589793

    ; Assign a Local variable the formula to switch from radian to degree (equals to one radian in degree).
    Local $fRadToDeg = 180 / $PI

    ; Assign a Local variable a number in degree.
    Local $fArcTan2 = $fRadToDeg * ATan(1)

    ; Display the result.
    MsgBox($MB_SYSTEMMODAL, "", $fArcTan2 & " deg.")
EndFunc   ;==>Example

Example 2

; Example of using ATan with degrees
#include <Math.au3>
#include <MsgBoxConstants.au3>

Local $fDegree = _Degree(ATan(1))

MsgBox($MB_SYSTEMMODAL, Default, "ATan(1) = " & $fDegree & " degrees")