From 1e819a2acfd658d7e0aa2892f1815256d5fa2ef5 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Tue, 8 Oct 2024 09:55:35 +0200 Subject: [PATCH] Fix pointDistanceSq Signed-off-by: Mark Tolmacs --- packages/math/point.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/math/point.ts b/packages/math/point.ts index e24bd29c3e..398eb9f849 100644 --- a/packages/math/point.ts +++ b/packages/math/point.ts @@ -213,7 +213,7 @@ export function pointDistance

(a: P, b: P): number { * @returns The euclidean distance between the two points. */ export function pointDistanceSq

(a: P, b: P): number { - return Math.hypot(b[0] - a[0], b[1] - a[1]); + return Math.pow(b[0] - a[0], 2) + Math.pow(b[1] - a[1], 2); } /**