feat: cleaned code

This commit is contained in:
TrèsAbhi committed 2024-01-02 21:10:04 -06:00
1 parent 60164cfb78
commit f15bee34fb
2 files changed
+96 -139

No files matched your search

+3 -9
View File
@@ -1,12 +1,6 @@
export function normalizeAngle180(angle: number) {
export function normalizeAnglePI(angle: number) {
const newAngle = angle % (2 * Math.PI);
if (newAngle > Math.PI) {
return newAngle - 2 * Math.PI;
}
if (newAngle < -Math.PI) {
return newAngle + 2 * Math.PI;
}
if (newAngle > Math.PI) return newAngle - 2 * Math.PI;
if (newAngle < -Math.PI) return newAngle + 2 * Math.PI;
return newAngle;
}