From 7f68f2d66cc72a7e23e1dfd876b910018a5f0226 Mon Sep 17 00:00:00 2001 From: core Date: Wed, 17 May 2023 21:52:28 -0400 Subject: [PATCH] use better math --- client/src/gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/gateway.ts b/client/src/gateway.ts index 4bdf1ccfd3ccaab32ae08f5d0709f6e5d49a7e52..39fb1c64d6fda73436ab2a87832cd9fae0ea9c99 100644 --- a/client/src/gateway.ts +++ b/client/src/gateway.ts @@ -158,7 +158,7 @@ export async function gateway_connect(gateway_url: string, username: string): Pr global.velocity = total_vel; // calc theta - global.direction_radians = Math.atan(global.y_vel / global.x_vel); + global.direction_radians = Math.atan2(global.y_vel, global.x_vel); } global.me = pkt.players[i];