How to make sure the result of lat/lng distance calculation is correct

I'm very novice to GIS systems, and I'm trying to fulfill a requirement. I've created a small program to calculate the distance of a given lat/lng pair, based on `this answer`.

However, for a city like Tehran which is more like a horizontal rectangle, the width is way less than the height.

Since a small city might be regarded as a flat surface comparing to the curvature of Earth, I expect the results to be valid for visual inspection.

So I also went online to calculate the result, and from this site, the calculation again shows the same numbers, that is, the width is unbelievably smaller than the height.

To get the latitude and longitude, I simply used Google Maps and here are the values:

**leftmost latitude = 35.7267243
rightmost latitude = 35.7442993

topmost longitude = 51.4743653
bottommost longitude = 51.4347113**

Apparently I did something wrong, but I can't really make it work. Can you please help me?

Your bounding box is wrong, it should roughly be

35.834107; 51.095724
35.561986; 51.605215

Before worrying about the width/height ratio, one would have identified that 2km * 3 km is rather a small size for such a large city...
One degree is about 100 km (see the order of magnitude table), so, knowing your city, you should have a bounding box with 0.5 to 1 degree in width/height, not 0.05.

• How to get the lat/lng of a place? I right-click on the point, select "what's here", and it gives me the lat/lng. Is it wrong? Commented Jun 4, 2017 at 18:33
• That sounds good. Using you coords, it seems you might have kept the latitude of the most eastern/western point, and the longitude of the northern/southern point (i.e. discarding the wrong coord to establish the bounding box)
– JGH
Commented Jun 4, 2017 at 18:55
• thank you for your help. The key term `bounding box` helped me go find the problem. I had a very embarrassing deep misunderstanding of the terms. I thought `latitude` means vertical lines to the equator. Such a shame. Commented Jun 5, 2017 at 4:55