time for a snapshot
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { add, scale, type Vec } from "./given.ts";
|
||||
|
||||
/**
|
||||
* Advance a position by a velocity over `delta` milliseconds.
|
||||
* newPosition = position + velocity * delta
|
||||
*/
|
||||
export function integrate(pos: Vec, vel: Vec, delta: number): Vec {
|
||||
return add(pos, scale(vel, delta));
|
||||
}
|
||||
Reference in New Issue
Block a user