mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2025-10-09 16:46:00 +00:00
getDegreeAngleFromDirection fix
This commit is contained in:
@@ -8,5 +8,7 @@ export function randomPositiveOrNegative(): number {
|
||||
|
||||
export function getDegreeAngleFromDirection(x: number, y: number): number {
|
||||
const radianAngle = Math.atan2(y, x);
|
||||
return (radianAngle / Math.PI) * 180;
|
||||
const angle = (radianAngle / Math.PI) * 180;
|
||||
|
||||
return angle < 0 ? angle + 360 : angle;
|
||||
}
|
||||
|
Reference in New Issue
Block a user