What do you mean by "principles of continous functions"? The simplest and best way is to do what you say- find the equation of the perpendicular line.

Harder would be to write the distance function which is minimal only when its square, , is minimal, and find where the derivative is 0.