Calculating distance from a point to a vector equation of a line