Calculates distance of a point from a fixed length line.

In this picture then red point is within the scope of the line and shortest distance from the line is calculated at straight angle. For the blue point then it is outside of the scope of the line so shortest distance is no longer at straight angle.