Sample C code to find distance between two points on a single coordinate system, in the form:
point1 = (X1,Y1)
point2 = (X2,Y2)


#include <math.h>
distance = sqrt( pow((X2 - X1),2) + pow((Y2 - Y1),2) )


Note that this is only effective for two dimentional coordinate systems, though can be easilly modified to accomodate more.