function final_distance = dist_point_to_line (x1, y1, x2, y2, x3, y3) % finds the distance from a point to a line % distance from point to line formula % Created by Jim Work, University of South Carolina, August 13, 2003 distance = 0; distance = abs((((x3-x1)*(x2-x1))+((y3-y1)*(y2-y1)))/(sqrt((x1-x2)^2 + (y2-y1)^2))); final_distance = distance;