mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix pointDistanceSq
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
a177d33121
commit
1e819a2acf
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue