SyntaxFix
Write A Post
Hire A Developer
Questions
To find the distance between 2 points, you need to find the length of the hypotenuse in a right angle triangle with a width and height equal to the vertical and horizontal distance:
Math.hypot(endX - startX, endY - startY)