Distance between point and a line (from two points)

Try using the norm function from numpy.linalg

d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)

Leave a Comment