mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: cleaned code
This commit is contained in:
1 parent
60164cfb78
commit
f15bee34fb
2 files changed
+96
-139
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user