MCPcopy Create free account
hub / github.com/microsoft/SandDance / updateSpringElement

Function updateSpringElement

docs/app/js/sanddance-app.js:87549–87555  ·  view source on GitHub ↗
(prev, cur, dest, damping, stiffness)

Source from the content-addressed store, hash-verified

87547}
87548var EPSILON = 1e-5;
87549function updateSpringElement(prev, cur, dest, damping, stiffness) {
87550 var velocity = cur - prev;
87551 var delta = dest - cur;
87552 var spring = delta * stiffness;
87553 var damper = -velocity * damping;
87554 return spring + damper + velocity + cur;
87555}
87556function updateSpring(prev, cur, dest, damping, stiffness) {
87557 if (Array.isArray(dest)) {
87558 var next = [];

Callers 1

updateSpringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected