diff options
Diffstat (limited to 'engine/utils')
-rw-r--r-- | engine/utils/index.ts | 1 | ||||
-rw-r--r-- | engine/utils/normalizeVector.ts | 8 |
2 files changed, 0 insertions, 9 deletions
diff --git a/engine/utils/index.ts b/engine/utils/index.ts index 4e465c2..82a0d05 100644 --- a/engine/utils/index.ts +++ b/engine/utils/index.ts @@ -1,4 +1,3 @@ export * from "./rotateVector"; -export * from "./normalizeVector"; export * from "./dotProduct"; export * from "./clamp"; 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 }; -}; |