meo-canvas
    Preparing search index...

    Interface SpringConfig

    A spring's physical description. Every field has v1's default.

    interface SpringConfig {
        damping?: number;
        from?: number;
        mass?: number;
        stiffness?: number;
        to?: number;
        velocity?: number;
    }
    Index
    damping?: number

    How strongly motion is resisted. Defaults to 26.

    The three regimes are genuinely different solutions rather than one formula with edge cases: below 2 * Math.sqrt(stiffness * mass) the motion oscillates, exactly at it the approach is the fastest that does not overshoot, and above it the value crawls in without ever crossing.

    from?: number

    Where the motion starts. Defaults to 0.

    Also what a spring answers for any t at or below zero: it holds at from rather than at a literal 0, which are the same number only for a default spring.

    mass?: number

    Inertia. Defaults to 1. Heavier is slower to start and slower to stop.

    stiffness?: number

    How hard it pulls toward the target. Defaults to 170.

    Higher is faster and, at a fixed damping, overshoots further.

    to?: number

    Where it comes to rest. Defaults to 1.

    Approached asymptotically and never exactly reached, which is why springDuration exists -- a spring has no natural end, and a page count needs one.

    velocity?: number

    Speed at t = 0, in units per second. Defaults to 0.

    Positive points at the target, so a positive velocity on a spring already travelling that way arrives sooner and overshoots more.