MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ net_displacement() [1/2]

float MayaFlux::Kinesis::net_displacement ( const Memory::HistoryBuffer< glm::vec2 > &  history,
size_t  window 
)
inlinenoexcept

Net displacement across the newest window positions.

Parameters
historyBuffer of positions, capacity >= window
windowNumber of samples, minimum 2
Returns
Straight-line distance from history[window-1] to history[0]

Definition at line 468 of file Differential.hpp.

469{
470 window = window < 2 ? 2 : window;
471 return glm::length(history[0] - history[window - 1]);
472}

Referenced by net_displacement(), and straightness().

+ Here is the caller graph for this function: