ATan Function | |
Calculate the arc tangent of a number.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION ATan(
nNum AS USUAL
) AS FLOAT
public static Float ATan(
Usual nNum
)
Request Example
View SourceParameters
- 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 |
---|
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.
1? ATan(Tan(-1+PI)) <paramref name="" /> -1+PI
2? ATan(Tan(-1)) = -1
See Also