#49 : Code cleanup

This commit is contained in:
Vadim
2021-08-08 11:59:39 +03:00
parent e86d1d5e45
commit 257c78b327
3 changed files with 18 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
export const getDistance = (p1, p2) => {
const x = p2.x - p1.x;
const y = p2.y - p1.y;
const xDist = p2.x - p1.x;
const yDist = p2.y - p1.y;
return Math.sqrt((x * x) + (y * y));
return Math.sqrt((xDist * xDist) + (yDist * yDist));
}