disnace from a line in python from two points code example Example: distance of a point from a line python d = norm(np.cross(p2-p1, p1-p3))/norm(p2-p1)