FastLED 3.9.15
Loading...
Searching...
No Matches

◆ atan2_full_()

template<typename F>
F fl::detail::atan2_full_ ( F y,
F x )
inline

Definition at line 479 of file math.cpp.hpp.

479 {
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}
F atan_full_(F u) FL_NOEXCEPT
Definition math.cpp.hpp:467

References atan_full_(), FL_NOEXCEPT, fl::x, and fl::y.

Referenced by fl::atan2_impl_double(), and fl::atan2_impl_float().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: