Some of the information here should give you an idea.

http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=geometry1...