Tag Archives: Framework

C# – Calculating Distance between Zipcodes

Calculating the distance between ZIP codes has become a common feature in search engines. For instance, if you’re searching for restaurants, a Web site will often allow you to enter a ZIP code and display all of the restaurants within X miles of that ZIP code. Here is one way application developers to implement a ZIP code distance calculator using the .NET Framework and C#.

This article uses a derivation of the Haversine formula to calculate the distance between ZIP codes. The Haversine formula is used to determine the distance between two points on a sphere – in this case the earth. While this isn’t 100 percent accurate due to the earth not being a perfect sphere, it is probably as close as you’re going to get without getting out the tape measure!

Author: Zach Smith
Find TechRepublic Article Here.

Formula for techrepublic for Zipcode calculation of distances

Download PDF and Code Here