This commit is contained in:
kolaflash committed 2026-02-09 23:26:50 +01:00
1 parent fcc0f90198
commit f07dc0bf51
7 files changed
+211 -13

No files matched your search

+7
View File
@@ -7,6 +7,13 @@ export function createVector(x: number = 0, y: number = 0): Vector {
return { x, y };
}
export function copyVector(vector: Vector): Vector {
return {
x: vector.x,
y: vector.y,
};
}
export function fromPolar(direction: number, magnitude: number): Vector {
return {
x: Math.cos(direction) * magnitude,