16-bit sine ease-in function Takes an input value 0-65535 and returns an eased value 0-65535
Definition at line 265 of file ease.cpp.
265 {
266
267
268 if (i == 0)
269 return 0;
270
271
272
273
274
275
276 u32 angle = ((fl::u64)i * 4194304ULL) / 65535ULL;
278
279
280
281
282
283
284 const fl::i64 MAX_COS32 = 2147418112LL;
285
286
287 fl::i64 adjusted = MAX_COS32 - (fl::i64)cos_result;
288
289
290 fl::u64
result = (fl::u64)adjusted * 65535ULL + (MAX_COS32 >> 1);
291 u16 final_result = (u16)(
result / (fl::u64)MAX_COS32);
292
293 return final_result;
294}
Result type for promise operations.
static FASTLED_FORCE_INLINE i32 cos32(u32 angle)
References cos32().
Referenced by ease16(), and ease16().