UNPKG

177 BPlain TextView Raw
1export function adjustAngle(theta: number, min: number, max: number) {
2 while (theta < min) theta += Math.PI * 2;
3 while (theta > max) theta -= Math.PI * 2;
4 return theta;
5}