| 477 | |
| 478 | template <typename F> |
| 479 | inline F atan2_full_(F y, F x) FL_NOEXCEPT { |
| 480 | const F kPi = F(3.14159265358979323846); |
| 481 | const F kPiHalf = F(1.57079632679489661923); |
| 482 | // x == 0 special case: angle is ±π/2 (sign of y), or 0 when both are 0. |
| 483 | if (x == F(0)) { |
| 484 | if (y > F(0)) return kPiHalf; |
| 485 | if (y < F(0)) return -kPiHalf; |
| 486 | return F(0); |
| 487 | } |
| 488 | F a = atan_full_(y / x); |
| 489 | if (x < F(0)) { |
| 490 | a += (y >= F(0)) ? kPi : -kPi; |
| 491 | } |
| 492 | return a; |
| 493 | } |
| 494 | } // namespace detail |
| 495 | |
| 496 | float atan2_impl_float(float y, float x) { |
nothing calls this directly
no test coverage detected