| VFx_atan2 | VDx_atan2 | VEx_atan2 |
|
| Function | arcus tangens function of quotients |
|
| Syntax C/C++ | #include <VFmath.h>
int VF_atan2( fVector Z, fVector X, fVector Y, ui size );
int VFx_atan2( fVector Z, fVector X, fVector Y, ui size, float A, float B, float C ); |
| C++ VecObj | #include <OptiVec.h>
int vector<T>::atan2( const vector<T>& X, const vector<T>& Y );
int vector<T>::x_atan2( const vector<T>& X, const vector<T>& Y, const T& A, const T& B, const T& C ); |
| Pascal/Delphi | uses VFmath;
function VF_atan2( Z, X, Y:fVector; size:UInt ): IntBool;
function VFx_atan2( Z, X, Y:fVector; size:UInt; A, B, C:Single ): IntBool; |
|
| Description | normal versions: Zi = arctan( Yi / Xi )
expanded versions: Zi = C * arctan( Yi / (A*Xi+B) )
From Cartesian X -Y-coordinates, the angle of the corresponding polar coordinates is calculated.
Note: in comparison to the ANSI C function atan2, the ordering of the parameters X and Y is reversed. |
|
| Error handling | If Xi and Yi are both zero, a DOMAIN error results with the default result NAN ("not-a-number").
In C/C++, this error is handled by _matherr and _matherrl with Xi and Yi as e->x and e->y. |
|
| Return value | FALSE (0), if no error occurred, otherwise TRUE (non-zero). |
|
|