This commit is contained in:
Andras Schmelczer 2026-06-14 20:58:42 +01:00
commit fc9df09ee1

View file

@ -0,0 +1,6 @@
export const interpolateAngles = (from: number, to: number, q: number) => {
const max = Math.PI * 2;
const possibleDistance = (to - from) % max;
const shorterDistance = ((2 * possibleDistance) % max) - possibleDistance;
return from + shorterDistance * q;
};