troubleshooting Question

Center point of a rectangle on a cartesian map

Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox asked on
Math / Science
8 Comments2 Solutions475 ViewsLast Modified:
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!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 8 Comments.
Join the Community
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.
Unlock 2 Answers and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros