WIP WIP
This commit is contained in:
1 parent
b191757922
commit
941474041b
3 files changed
+63
-5
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user