What is the distance formula
I believe this page says it all:
http://www.purplemath.com/modules/distform.htm