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

◆ angular_velocity() [1/2]

float MayaFlux::Kinesis::angular_velocity ( const Memory::HistoryBuffer< float > &  headings,
double  dt 
)
inlinenoexcept

Angular velocity from consecutive headings in a HistoryBuffer.

Parameters
headingsBuffer of heading angles in radians, capacity >= 2
dtElapsed time between samples 0 and 1
Returns
Signed rate of heading change in radians per second, wrapped correctly across the -pi/pi seam

Takes a HistoryBuffer<float> of already-computed headings rather than positions directly, since heading is itself derived (see heading() above) and keeping this function ignorant of that derivation keeps it reusable for any angle-producing source, not only motion.

Definition at line 375 of file Differential.hpp.

376{
377 return angular_delta(headings[0], headings[1]) / static_cast<float>(dt);
378}
float angular_delta(float to, float from) noexcept
Shortest signed angular difference between two headings.

References angular_delta().

Referenced by angular_velocity().

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