calculate

fun calculate(timestamp: ComparableTimeMark = TimeSource.Monotonic.markNow(), current: MotionState<U>, goal: MotionState<U>): MotionState<U>(source)

Calculates the state of the profile at a given timestamp.

On the first call, this method records the start timestamp and uses it to compute elapsed time on subsequent calls.

Return

The state of the profile at the given timestamp.

Parameters

timestamp

The current timestamp.

current

The current state of the system.

goal

The desired goal state.


Calculates the state of the profile at a given time.

Return

The state of the profile at time t.

Parameters

t

The time since the beginning of the profile

current

The current state of the system.

goal

The desired goal state.