distance from point to point python code example
Example 1: python distance of coordinates
dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
Example 2: distance of a point from a line python
d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)
dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)