js distance from 1 point to another code example Example: javascript distance between two points Math.hypot(x2-x1, y2-y1)