in reply to Zipcode Proximity script
Update: I notice that your perl code uses a flat-geometric distance rather than a curved-earth great circle distance. That's probably good enough for typical geometric queries (like "50 miles from my house"). But you could do the same thing in the C program. You could also search using the distance squared and avoid all those square roots.
my $xdelta = $x1-$x2; my $ydelta = $y1-$y2; my $distance_squared = $xdelta*$xdelta + $ydelta*$ydelta;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Zipcode Proximity script
by hacker (Priest) on Mar 31, 2003 at 16:25 UTC |