title: How do I get the latitude and longitude of a rectangle if I know the center and top left GPS positions?
body: <h1>Background:</h1>
  
  <p>I'm trying to use a Google maps <a href="https://developers.google.com/maps/documentation/javascript/examples/groundoverlay-simple" rel="nofollow noreferrer">ground overlay</a> but we are missing GPS positions.</p>
  
  <p>We have a map to overlay that was drawn over a Google Maps screenshot. From this screenshot we recorded the Top Left and Center Center position.</p>
  
  <p>We require the bottom right position to accurately overlay these images. See below:</p>
  
  <p><a href="https://i.stack.imgur.com/xGyz4.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xGyz4.gif" alt="Top Left positions and center positions GPS known"></a></p>
  
  <p>The intial thinking is finding the difference between the two points and adding that onto the center point.</p>
  
  <h1>Attempted logic:</h1>
  
  <p>In JavaScript:</p>
  
  <pre><code>var topLeft      = [-32.8830055, 151.686214];
  var centerCenter = [-32.9293803, 151.756686];
  
  var difference1 = centerCenter[0] - ( (topLeft[0] - centerCenter[0] ) ) ;
  var difference2 = centerCenter[1] - ( (topLeft[1] - centerCenter[1] ) ) ;
  
  // being bottom right this should be "bigger" than above values
  // outputs [-32.97575509999999, 151.827158];
  var bottomRight  = [difference1 , difference2];
  </code></pre>
  
  <h1>Problem:</h1>
  
  <p>However it appears this is where the curve of the earth throws that simple maths out the door. I'm guessing that what is happening below is why.</p>
  
  <p><a href="https://i.stack.imgur.com/GqUrZ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GqUrZ.gif" alt="The image overlay is flat while the GPS system is curved."></a></p>
  
  <p>So given I have a rectangle overlay and I know the top left point and the center point <strong>can I work out the latitude and longitude of the bottom right point</strong> I.e X in the above diagram. Note I do not know the real world distances of this rectangle.</p>
  
  <p><em>Note: I also know that I will have to change these to NW / SE to use ground overlays.</em></p>