title: How do you find the 4 corners of a Google Map V3 when the map is rotated?
body: <p>Google maps V3 API has a <a href="https://developers.google.com/maps/documentation/javascript/reference?#Map" rel="nofollow noreferrer">getBounds</a> method on the map that returns you the Northeast and Southwest corners of the viewport.  In theory, I could calculate the Northwest and Southeast corners by using the latitude and longitude of the opposite points, i.e.</p>
  
  <p>NE = (lat= 37.5, lng= -97.5)<br>
  SW = (lat= 37.0, lng= -96)<br>
  ... therefore ...<br>
  NW = (lat= 37.5, lng= -96)<br>
  SE = (lat= 37.0, lng= -97.5)  </p>
  
  <p>(there was even a <a href="https://stackoverflow.com/questions/3891066/how-do-i-get-the-coordinates-of-all-four-corners-of-a-rectangle">post about this 5 years ago</a>.)</p>
  
  <p>But all of the answers I've found anywhere online assume the map is pointing due North, meaning "Northeast" really means "top right".  </p>
  
  <p>But what happens if the map is rotated? Do I have to use trig based on the orientation of the map to figure out the other two corners?  Or does Google give me actual Northeast and Southwest coordinates of an area that encompasses what's in my viewport, even if that means the resulting rectangle has parts that fall outside of the bounds of a rotated map?</p>