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

◆ linear()

TimeMap MayaFlux::Kinesis::TimeMaps::linear ( double  from,
double  to,
double  duration 
)
inline

Straight path from one position to another, then constant.

Parameters
fromPosition at time zero
toPosition reached at duration and kept after
durationSeconds to travel, zero or less gives to at every time

Definition at line 25 of file TimeMap.hpp.

26{
27 return { .fn = [from, to, duration](const double& t) -> double {
28 if (duration <= 0.0) {
29 return to;
30 }
31 return map_clamped<double>(t, 0.0, duration, from, to);
32 } };
33}

References MayaFlux::Kinesis::Tendency< D, R >::fn.