Click or drag to resize

ATan Function

X#
Calculate the arc tangent of a number.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION ATan(
	nNum AS USUAL
) AS FLOAT
Request Example View Source

Parameters

nNum
Type: Usual
Any numeric value.

Return Value

Type: Float
A number between -PI/2 and PI/2, representing the angle, in radians, whose tangent is equal to nNum.
Remarks
Tip Tip
The result only spans half a circle (from -PI/2 to PI/2).
This implies that Tan() and ATan() are not inverse functions for values that do not lie between -PI/2 and PI/2. In other words, ATan(Tan(n)) does not always return n. See the example below.
Examples
This example shows that, for a value of -1+PI, ATan() is not the inverse of Tan() but, for a value of -1, ATan() is the inverse of Tan().
This is because the tangent of -1+PI is equal to Tan(-1+PI) or -1.56.
The tangent of -1 is also equal to Tan(-1) or -1.56.
The ATan() of -1.56 is ATan(-1.56) or -1. Thus ATan(Tan(-1)) equals -1. But ATan(Tan(-1+PI)) equals -1 which is not equal to -1+PI.
X#
1? ATan(Tan(-1+PI)) <paramref name="" /> -1+PI        // TRUE
2? ATan(Tan(-1)) = -1            // TRUE
See Also