FastLED 3.10.8
Loading...
Searching...
No Matches

◆ atan2_full_()

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

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

561 {
562 const F kPi = F(3.14159265358979323846);
563 const F kPiHalf = F(1.57079632679489661923);
564 // x == 0 special case: angle is ±π/2 (sign of y), or 0 when both are 0.
565 if (x == F(0)) {
566 if (y > F(0)) return kPiHalf;
567 if (y < F(0)) return -kPiHalf;
568 return F(0);
569 }
570 F a = atan_full_(y / x);
571 if (x < F(0)) {
572 a += (y >= F(0)) ? kPi : -kPi;
573 }
574 return a;
575}
F atan_full_(F u) FL_NO_EXCEPT
Definition math.cpp.hpp:549

References atan_full_(), fl::FL_NO_EXCEPT, 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: