ATN(number)

Returns the arc-tangent of a number in radians (Double).


numberThe number you want the arc-tangent of (Double).

REMARKS
* This function takes the ratio of two sides of a right angled triangle and returns the corresponding angle in radians.
* The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.
* The arc-tangent of a number is the inverse of the TAN function.
* The "number" can be any valid numeric expression.
* The value returned can be in the range -PI/2 to PI/2.
* If your argument is in degrees, multiply it by PI/180 to convert it to radians.
* If your argument is in radians, multiply it by 180/PI to convert it to degrees.
* The reciprocal of this function (1/TAN) is called the cotangent.
* The equivalent Excel function is Application.WorksheetFunction.ATAN
* The equivalent .NET function is System.Math.Atn
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print Atn(0)     '= 0  
Debug.Print Atn(1) '= 0.785
Debug.Print Atn(-1) '= 0.785
Debug.Print Atn(-50) '= 0.785

Dim lPi As Long
lPi = 4 * Atn(1)
Debug.Print lPi '= 3

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top