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

◆ atan() [2/2]

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

Definition at line 181 of file s16x16.h.

181 {
182 constexpr s16x16 one(1.0f);
183 constexpr s16x16 pi_over_2(1.5707963f);
184 bool neg = x.mValue < 0;
185 s16x16 ax = abs(x);
187 if (ax <= one) {
188 result = atan_unit(ax);
189 } else {
190 result = pi_over_2 - atan_unit(one / ax);
191 }
192 return neg ? -result : result;
193 }
constexpr s16x16() FL_NOEXCEPT=default
constexpr FASTLED_FORCE_INLINE s16x16 abs() const FL_NOEXCEPT
Definition s16x16.h:263
static FASTLED_FORCE_INLINE s16x16 atan_unit(s16x16 t) FL_NOEXCEPT
Definition s16x16.h:421
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31

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

+ Here is the call graph for this function: