2

If I have a rectangle, in which top left point corresponds to a specific location (lat1, lng1) and center corresponds to another location (lat2, lng2), how can I find to which location corresponds bottom right point?

I will try to illustrate now what I mean. I have a rectangle (by rectangle I mean an actual map area, a randomly zoomed-in part of Mercator projection) (say x in width and y in height) with L point in top left, M point in the center and R point in the bottom right:

L----------------------+
|                      |
|                      |
|                      |
|          M           |
|                      |
|                      |
|                      |
+----------------------R

L(0, 0) or L(-x/2, y/2) (whichever coordinate system you prefer) corresponds to (lat1, lng1) and M corresponds to (lat2, lng2) which are known. Is it possible to find (lat3, lng3) of R from the given data? It is safe to assume that lat1 > lat2 and lng1 < lng2 always.

I have tried adjusting this formula (which is basically the inverse of my task) to solve the problem, but could not come to solvable equation, and the resulting system did not look easily solvable.

5
  • 1
    Welcome to GIS SE. Could you provide more properties of your "rectangle" ? Is your center the projection of the center of gravity, do you want the center to separate two parts with the same area ?
    – radouxju
    Dec 19, 2016 at 13:34
  • You're starting out wrong if the coordinates are "lat,lng", since latitude is a Y value. Spherical rectangles are strange ducks, and spheroidal rectangles are stranger still. Please edit the question to specify the range of potential latitudes involved. Your "rectangles" will need to look like parallelograms.
    – Vince
    Dec 19, 2016 at 13:45
  • @radouxju updated the question
    – Mikhail
    Dec 19, 2016 at 14:09
  • @Vince updated the question
    – Mikhail
    Dec 19, 2016 at 14:09
  • You need to use optimisation procedure (scipy) to solve it numerically. Long,lat are 2 unknowns parameters to optimize, distance to M point is objective function to find a minimum of
    – FelixIP
    Dec 19, 2016 at 21:14

1 Answer 1

1

Unless I am missing information, you should just be able to find the difference b/w your top left and center coordinates, then double that difference to get the bottom right coordinate.

1
  • Thank you for your answer! While this approach would work with an acceptable error on higher zoom levels, it will not work on smaller zoom levels. For example, if L is (69.468616; -42.179178) and M is (52.376142, 4.908439) then R's latitude would be 51.996056, while the actual location would have latitude around 54.
    – Mikhail
    Dec 19, 2016 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.