How do you know that the shortest time is when the origin is perpendicular to a known straight line?
The minimum value of the square of m plus the square of n can be regarded as the minimum value of the square of the distance from (m, n) to (0,0), which is the shortest when it is vertical, and because (m, n) is on a straight line, the shortest distance is the vertical distance from the origin to this straight line, so it can be calculated by the following formula.