| 54 | static const float atan2_p7 = -0.04432655554792128f*(float)(180/CV_PI); |
| 55 | |
| 56 | float fastAtan2( float y, float x ) |
| 57 | { |
| 58 | float ax = std::abs(x), ay = std::abs(y); |
| 59 | float a, c, c2; |
| 60 | if( ax >= ay ) |
| 61 | { |
| 62 | c = ay/(ax + (float)DBL_EPSILON); |
| 63 | c2 = c*c; |
| 64 | a = (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c; |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | c = ax/(ay + (float)DBL_EPSILON); |
| 69 | c2 = c*c; |
| 70 | a = 90.f - (((atan2_p7*c2 + atan2_p5)*c2 + atan2_p3)*c2 + atan2_p1)*c; |
| 71 | } |
| 72 | if( x < 0 ) |
| 73 | a = 180.f - a; |
| 74 | if( y < 0 ) |
| 75 | a = 360.f - a; |
| 76 | return a; |
| 77 | } |
| 78 | |
| 79 | static void FastAtan2_32f(const float *Y, const float *X, float *angle, int len, bool angleInDegrees=true ) |
| 80 | { |
no test coverage detected