troubleshooting Question

# Center point of a rectangle on a cartesian map

Math / Science
Hi,

This is similar to another question I had previously. I have a rectangle, which is placed on a cartesian map. I know the latitude/longitude of the 4 corner points. Something like:

lat1 = top corner
lon1 = left corner
lat2 = bottom corner
lon2 = right corner

I just want to find the center point of the box, in lat, longitude. I can do this:

centerLat = lat1 + ((lat2-lat1) / 2.0);
centerLon = lon1 + ((lon2-lon1) / 2.0);

but is that sufficient, considering that the values can "wrap" around the globe at some points?Also not sure about if the equaton for latitude is correct since it increases on the map as you go north?

Thanks
Join the community to see this answer!
###### Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.