Make physics more fun

This commit is contained in:
schmelczerandras 2020-10-16 11:48:52 +02:00
parent 155e360c8e
commit 89fafeafd3
41 changed files with 511 additions and 334 deletions

View file

@ -0,0 +1,9 @@
const shortAngleDist = (a0: number, a1: number): number => {
const max = Math.PI * 2;
const da = (a1 - a0) % max;
return ((2 * da) % max) - da;
};
export const interpolateAngles = (a0: number, a1: number, t: number) => {
return a0 + shortAngleDist(a0, a1) * t;
};