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

◆ atan() [2/2]

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

Definition at line 207 of file s16x16.h.

207 {
208 constexpr s16x16 one(1.0f);
209 constexpr s16x16 pi_over_2(1.5707963f);
210 bool neg = x.mValue < 0;
211 s16x16 ax = abs(x);
213 if (ax <= one) {
214 result = atan_unit(ax);
215 } else {
216 result = pi_over_2 - atan_unit(one / ax);
217 }
218 return neg ? -result : result;
219 }
static FASTLED_FORCE_INLINE s16x16 atan_unit(s16x16 t) FL_NO_EXCEPT
Definition s16x16.h:465
constexpr FASTLED_FORCE_INLINE s16x16 abs() const FL_NO_EXCEPT
Definition s16x16.h:307
constexpr s16x16() FL_NO_EXCEPT=default
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

References s16x16(), abs(), atan_unit(), FASTLED_FORCE_INLINE, fl::FL_NO_EXCEPT, and fl::x.

+ Here is the call graph for this function: