Copyright © University of Cambridge. All rights reserved.
Created with GeoGebra 
Triangle ABC is any right angled triangle and X is a moveable point on the hypotenuse AC. The points P and Q are the feet of the perpendiculars from X to the sides of the triangle.
Find the position of X which makes the length of PQ a minimum.

This dynamic image is drawn using Geogebra, free software and very easy to use. You can download your own copy of Geogebra from http://www.geogebra.org/cms/ together with a good help manual and Quickstart for beginners.