A simple physics engine in TypeScript