# Given a top left location and center location find bottom right location

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.

• 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 ? 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. Dec 19, 2016 at 13:45
• @radouxju updated the question Dec 19, 2016 at 14:09
• @Vince updated the question 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 Dec 19, 2016 at 21:14

• 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`. Dec 19, 2016 at 16:34