added function to calculate distance from a point to line