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

◆ spread_radius() [1/2]

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

Bounding radius of a window around its centroid.

Parameters
historyBuffer of positions, capacity >= window
windowNumber of samples, minimum 1
Returns
Maximum distance from centroid to any sample in the window

A cheap containment/extent measure: how large a circle a gesture currently occupies, independent of how much path length it traced to get there. A tight scribble and a single large slow circle can have similar path_length but very different spread.

Definition at line 539 of file Differential.hpp.

540{
541 const glm::vec2 c = centroid(history, window);
542 float max_dist = 0.0F;
543 for (size_t i = 0; i < window; ++i)
544 max_dist = std::max(max_dist, glm::length(history[i] - c));
545 return max_dist;
546}
glm::vec2 centroid(const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
Mean position across a window.

References centroid().

Referenced by spread_radius().

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