|
Fast arc tangent using table lookup and linear interpolation.
- Parameters:
-
| y | component of input vector |
| x | component of input vector |
- Returns:
- float angle angle of vector (x, y) in radians
This function calculates the angle of the vector (x,y) based on a table lookup and linear interpolation. The table uses a 256 point table covering -45 to +45 degrees and uses symetry to determine the final angle value in the range of -180 to 180 degrees. Note that this function uses the small angle approximation for values close to zero. This routine calculates the arc tangent with an average error of +/- 0.045 degrees. |