16-bit sine ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
Definition at line 274 of file ease.cpp.hpp.
274 {
275
276
277 if (i == 0)
278 return 0;
279
280
281
282
283
284
285 u32 angle = ((fl::u64)i * 4194304ULL) / 65535ULL;
287
288
289
290
291
292
293 const fl::i64 MAX_COS32 = 2147418112LL;
294
295
296 fl::i64 adjusted = MAX_COS32 - (fl::i64)cos_result;
297
298
299 fl::u64
result = (fl::u64)adjusted * 65535ULL + (MAX_COS32 >> 1);
300 u16 final_result = (u16)(
result / (fl::u64)MAX_COS32);
301
302 return final_result;
303}
FASTLED_FORCE_INLINE i32 cos32(u32 angle) FL_NO_EXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
References cos32().
Referenced by ease16(), and ease16().