My solution to a problem submitted here : http://linustechtips.com/main/topic/180486-problem-solving-3-polygon-phobia/