In order to find the distance of the line from the point P(4,1) along another line, we have to find the point of intersection of both the lines.
For this purpose, we will first find the equation of the second line. Slope of second line is tan135∘=−1. Equation of the line with slope −1 and through the point P(4,1) is y−1=−1(x−4) or x+y−5=0…(ii)
Solving (i) and (ii), we get x=1 and y=4 so that point of intersection of the two lines is Q(1,4). Now, distance of line (i) from the point P(4,1) along the line (ii) = distance between the points P(4,1) and Q(1,4) =(1−4)2+(4−1)2 =32 units.