Fix pointDistanceSq

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
pull/8539/merge^2
Mark Tolmacs 5 months ago
parent a177d33121
commit 1e819a2acf
No known key found for this signature in database

@ -213,7 +213,7 @@ export function pointDistance<P extends GenericPoint>(a: P, b: P): number {
* @returns The euclidean distance between the two points.
*/
export function pointDistanceSq<P extends GenericPoint>(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);
}
/**

Loading…
Cancel
Save