MCPcopy Create free account
hub / github.com/FastLED/FastLED / atan2_full_

Function atan2_full_

src/fl/math/math.cpp.hpp:479–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477
478template <typename F>
479inline 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
496float atan2_impl_float(float y, float x) {

Callers

nothing calls this directly

Calls 2

FClass · 0.85
atan_full_Function · 0.85

Tested by

no test coverage detected