Spring force
Copy
// 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: Copy
[Read more](https:
Anchored end of the spring
Length of spring-at-rest (default: 0.5)
Spring stiffness (default: 0.0002)
Damping factor to apply, so spring slows over time. (default: 0.995)
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();