diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-12 13:49:16 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-12 13:49:16 -0600 |
commit | c6e9baa0009f7cce0f6ff156a3957ef04a8cb684 (patch) | |
tree | 9766a4a33ad1c86aa71a5f92daf8917f3e5f5eed /engine/utils/normalizeVector.ts | |
parent | b67ffb57c1bf6e9628339a3f43c71ccebdb46136 (diff) | |
download | jumpstorm-c6e9baa0009f7cce0f6ff156a3957ef04a8cb684.tar.gz jumpstorm-c6e9baa0009f7cce0f6ff156a3957ef04a8cb684.zip |
the great engine refactor
Diffstat (limited to 'engine/utils/normalizeVector.ts')
-rw-r--r-- | engine/utils/normalizeVector.ts | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/engine/utils/normalizeVector.ts b/engine/utils/normalizeVector.ts deleted file mode 100644 index e6dfd7f..0000000 --- a/engine/utils/normalizeVector.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Coord2D } from "../interfaces"; - -export const normalizeVector = (vector: Coord2D): Coord2D => { - const { x, y } = vector; - const length = Math.sqrt(x * x + y * y); - - return { x: x / length, y: y / length }; -}; |