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

◆ direction_sign() [1/2]

double MayaFlux::Kinesis::direction_sign ( const Memory::HistoryBuffer< double > &  history,
double  dt 
)
inlinenoexcept

Sign of a scalar first difference.

Parameters
historyBuffer with capacity >= 2
dtElapsed time between samples 0 and 1
Returns
-1.0, 0.0, or 1.0

Definition at line 269 of file Differential.hpp.

270{
271 const double v = velocity(history, dt);
272 return (v > 0.0) ? 1.0 : ((v < 0.0) ? -1.0 : 0.0);
273}
T velocity(const Memory::HistoryBuffer< T > &history, double dt) noexcept
First difference: rate of change of position.

References velocity().

Referenced by direction_sign().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: