This commit is contained in:
kolaflash
2026-02-09 23:26:50 +01:00
parent fcc0f90198
commit f07dc0bf51
7 changed files with 211 additions and 13 deletions
+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,