|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
|
inlinenoexcept |
N-th order backward finite difference of a HistoryBuffer, scaled by dt^N.
| N | Difference order. 1 velocity, 2 acceleration, 3 jerk, 4 jounce, 5 crackle, 6 pop. |
| T | Sample type. Must support operator+, operator-, and multiplication/division by scalar_t<T>. |
| history | Buffer with capacity >= N + 1, [0] newest through [N] oldest used |
| dt | Elapsed time between consecutive samples, assumed uniform across all N intervals |
Named wrappers below (velocity, acceleration, jerk, jounce, crackle, pop) are instantiations of this at fixed N. A caller needing N = 7 or higher calls backward_difference<7>(history, dt) directly.
dt == 0 is not guarded: the correct response depends on the caller's domain, so this stays a pure computation.
Uniform dt across all N intervals is an assumption, not a check. HistoryBuffer carries no per-sample timestamps.
HistoryBuffer::operator[] indexes modulo capacity, not modulo the number of samples actually pushed. Querying history[k] before k samples have been pushed reads the zero initial condition.
Definition at line 42 of file Differential.hpp.