For FP3 there is a standard formula that gives you the shortest distance from a point to a line. Alternatively you could find an equation of the line from N that is perpendicular to PR. Then using the fact that the line you found the equation when dot multiplied with the direction of PR will be 0 you can find the value of the parameter which enables you to easily find the distance.