← back to roto on ba3a.dev

movingAverage

fun movingAverage(values: List<Double>, window: Int): List<Double>

The centred moving average of values over window frames. Near either end the window shrinks evenly on both sides, so a figure moving at a steady speed is followed exactly.