Documentation
    Preparing search index...

    Class DampedSpringTrajectory

    Damped harmonic motion from from to to (§13 "damped spring"), released from rest.

    The closed form of x'' + 2ζωₙ·x' + ωₙ²·(x − to) = 0 with x(0) = from and x'(0) = 0, where ωₙ = 2π·frequencyHz and ζ = dampingRatio. Writing d = from − to:

    ζ < 1   x = to + d·e^(−σt)·(cos ω_d t + (σ/ω_d)·sin ω_d t)
            v = −d·(ωₙ²/ω_d)·e^(−σt)·sin ω_d t          σ = ζωₙ, ω_d = ωₙ√(1−ζ²)
    ζ = 1   x = to + d·e^(−ωₙt)·(1 + ωₙt)
            v = −d·ωₙ²·t·e^(−ωₙt)
    ζ > 1   x = to + c₁·e^(r₁t) + c₂·e^(r₂t)             r = −ωₙ(ζ ∓ √(ζ²−1))
            v = c₁r₁·e^(r₁t) + c₂r₂·e^(r₂t)
    

    Acceleration is taken from the differential equation itself, a = −2ζωₙ·v − ωₙ²·(x − to), which is exact in every regime and needs no third set of coefficients.

    All three components share one scalar envelope: this is a spring pulling a point along the straight line from → to, not three independent springs (they would be identical anyway, since all three have the same frequency and start at rest).

    duration is the settling time: four time constants of the slowest decay (4/σ, with σ = ζωₙ when underdamped and the slower pole's rate when over- or critically damped) — the point past which the remaining motion is invisible. It is Infinity for an undamped spring (ζ = 0), which never settles.

    Implements

    Index
    dampingRatio: number

    Damping ratio.

    duration: number

    Settling time in seconds (four time constants), or Infinity when undamped.

    frequencyHz: number

    Undamped natural frequency in hertz.

    from: Vector3

    Position at time = 0.

    Rest position.