ixfx
    Preparing search index...

    Function springForce

    • Spring force

      • 
        

      // End of spring that moves let thing = { position: { x: 1, y: 0.5 }, mass: 0.1 };

      // Anchored other end of spring const pinnedAt = {x: 0.5, y: 0.5};

      // Create force: length of 0.4 const springForce = Forces.springForce(pinnedAt, 0.4);

      continuously(() => { // Apply force thing = Forces.apply(thing, springForce); }).start();

      [Read more](https:
      

      Parameters

      • pinnedAt: Geometry.Point

        Anchored end of the spring

      • restingLength: number = 0.5

        Length of spring-at-rest (default: 0.5)

      • k: number = 0.0002

        Spring stiffness (default: 0.0002)

      • damping: number = 0.999

        Damping factor to apply, so spring slows over time. (default: 0.995)

      Returns (t: ForceAffected) => ForceAffected