Wrong understanding, it is not the points M and N that move to the origin, but the vertical foot (from the origin to the straight line), and the vertical foot point is on the straight line.
M, n in a straight line, the meaning of m2+n2 is the distance from the origin to the point m, n, and the shortest distance is when the line is perpendicular to the straight line.