XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Atan2()

Function Atan2 ( Y As  Double,
X As  Double,
Optional Info As  Long 
)

arctan2(y, x)

Purpose
Computes the principal value of the arc tangent of y/x in radians. It is the angle from the coordinate origin to a point (x, y) as measured from the positive x-axis. When x > 0, arctan2(y, x) equals to arctan(y/x). When x = 0, it is π/2 if y > 0 and -π/2 if y < 0.
Returns
Double
arctan2(y, x). (-π <= arctan2(y, x) <= π)
Parameters
[in]YArgument y. (x <> 0 or y <> 0)
[in]XArgument x. (x <> 0 or y <> 0)
[out]Info(Optional)
= 0: Successful exit.
= -1: The argument X or Y had an illegal value. (X = 0 and Y = 0) (returns 0)