This commit is contained in:
kolaflash
2026-01-04 23:22:32 +01:00
parent b191757922
commit 941474041b
3 changed files with 63 additions and 5 deletions
+7
View File
@@ -29,6 +29,13 @@ export function getDistance(a: Vector, b: Vector): number {
return Math.sqrt(dx * dx + dy * dy);
}
export function getDistanceSquared(a: Vector, b: Vector): number {
const dx = a.x - b.x;
const dy = a.y - b.y;
return dx * dx + dy * dy;
}
export function getSquared(vector: Vector): number {
return vector.x * vector.x + vector.y * vector.y;
}