Function accelerationForce

Apples vector to acceleration, scaling according to mass, based on the mass option. It returns a function which can later be applied to a thing.

import { Forces } from "https://unpkg.com/ixfx/dist/modulation.js"
// Acceleration vector of (0.1, 0), ie moving straight on horizontal axis
const f = Forces.accelerationForce({ x:0.1, y:0 }, `dampen`);

// Thing to move
let t = { position: ..., acceleration: ... }

// Apply force
t = f(t);