This commit is contained in:
kolaflash committed 2026-01-04 23:22:32 +01:00
1 parent b191757922
commit 941474041b
3 files changed
+63 -5

No files matched your search

+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;
}