MCPcopy Create free account
hub / github.com/FastLED/FastLED / easeOutQuad16

Function easeOutQuad16

src/fl/math/ease.cpp.hpp:237–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237u16 easeOutQuad16(u16 i) {
238 // ease-out quadratic: 1 - (1-t)²
239 // For 16-bit: y = MAX - (MAX-i)² / MAX
240 constexpr u32 MAX = 0xFFFF; // 65535
241 constexpr u32 ROUND = MAX >> 1; // for rounding
242
243 fl::u64 d = MAX - i; // (MAX - i)
244 fl::u64 num = d * d + ROUND; // (MAX-i)² + rounding
245 return u16(MAX - (num / MAX));
246}
247
248u16 easeInCubic16(u16 i) {
249 // Simple cubic ease-in: i³ scaled to 16-bit range

Callers 1

ease16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected