This file provides a fast but approximate atan2 function. More...
#include <cmath>

Go to the source code of this file.
Functions | |
| float | fast_atan2 (float y, float x) |
Variables | |
| constexpr float | PI = 3.14159265359F |
| pi More... | |
| constexpr float | PI_2 = 1.5707963267948966F |
| pi/2 More... | |
This file provides a fast but approximate atan2 function.
Definition in file atan2_utils.h.
| float fast_atan2 | ( | float | y, |
| float | x | ||
| ) |
Approximation was taken from: http://www-labs.iro.umontreal.ca/~mignotte/IFT2425/Documents/EfficientApproximationArctgFunction.pdf
|Error = fast_atan2(y, x) - atan2f(y, x)| < 0.00468 rad
Octants: pi/2 3 | 2 / | / 4 ` | / 1 pi --—+--— 0 5 / | 8 / | / 6 | 7 ` 3pi/2
Definition at line 46 of file atan2_utils.h.
|
constexpr |
pi
Definition at line 24 of file atan2_utils.h.
|
constexpr |
pi/2
Definition at line 26 of file atan2_utils.h.