bounce

Function
bounce(
    s1: State,
    s2: State,
    at: float,
    dur: float,
    times: int = 2,
    easing: dict[str, Callable[[float], float]] | None = None
) -> list[KeyState]

Bounce between two states.

Parameters

s1
First state (start and end)
s2
Second state (peaks)
at
Start time
dur
Total duration
times
Number of bounces (2 = s1->s2->s1->s2->s1)
easing
Optional easing dict for transitions.

Examples

# Bounce twice between s1 and s2 over 0.2 duration
    .segment(bounce(s1, s2, at=0.3, dur=0.2, times=2))