Closest point to a line and shortest distance from origin