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

◆ atan() [2/2]

static FASTLED_FORCE_INLINE s8x8 fl::s8x8::atan ( s8x8 x)
inlinestatic

Definition at line 163 of file s8x8.h.

163 {
164 constexpr s8x8 one(1.0f);
165 constexpr s8x8 pi_over_2(1.5707963f);
166 bool neg = x.mValue < 0;
167 s8x8 ax = abs(x);
168 s8x8 result;
169 if (ax <= one) {
170 result = atan_unit(ax);
171 } else {
172 result = pi_over_2 - atan_unit(one / ax);
173 }
174 return neg ? -result : result;
175 }
constexpr s8x8() FL_NOEXCEPT=default
constexpr FASTLED_FORCE_INLINE s8x8 abs() const FL_NOEXCEPT
Definition s8x8.h:246
static FASTLED_FORCE_INLINE s8x8 atan_unit(s8x8 t) FL_NOEXCEPT
Definition s8x8.h:403
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References s8x8(), abs(), atan_unit(), FASTLED_FORCE_INLINE, FL_NOEXCEPT, and fl::x.

+ Here is the call graph for this function: