Forum Moderators: coopster
Point 1 = x1,y1
Point 2 = x2,y2
Then the distance between Point 1 and Point 2 (in scale units) is the square root of ((x2-x1)2 + (y2-y1)2), which is Pythagoras' Theorm...
[en.wikipedia.org...]
first you need the two coordinates of the two points.
Here an example for two points:
A(2¦3)
B(4¦6)
The vector beween the two points is:
v1 = [[x(B)-x(A)][y(B)-y(A)]] = [[4-2][6-3]] = [[2][3]]
the length of the vector is the square root of the sum of the squares of the the coordinates.
so your distance is:
d = sqrt( (x(v1)^2 + (y(v1))^2 ) = sqrt( (2)^2 + (3)^2 ) = sqrt ( 4 + 9 ) = sqrt( 13 ) = 3,6055512
now all you need to do is put this math in to a php script...
hope i could help
edit: yeah its the same as pythagoras
longitude\latitude of each zip code\postal code [webmasterworld.com]