title: How to rotate a polygon on a map with the long/lat coordinates?
body: <p><strong>I want to rotate a polygon (for example this arrow) by replacing the hardcoded offsets values with a function where can pass in the nord pointing offset and the amount of degrees I want the arrow to rotate at.</strong></p>
  
  <p>I tried using a <a href="https://en.wikipedia.org/wiki/Rotation_matrix" rel="nofollow noreferrer">Rotation matrix</a> but that did not work well.<br>
  Probably because the distance of
  1 Lat. != 1 Long.</p>
  
  <p>What I'm trying to do with this:<br>
  The arrow must represent a vehicle and rotate on the direction the vehicle is heading.  </p>
  
  <pre><code>double centerLatitude = pos.Coordinate.Point.Position.Latitude;
  double centerLongitude = pos.Coordinate.Point.Position.Longitude;
  
  MapPolygon mapPolygon = new MapPolygon();
  mapPolygon.Path = new Geopath(new List&lt;BasicGeoposition&gt;() {
      new BasicGeoposition() {Longitude=centerLongitude, Latitude=centerLatitude},//top of the arrow
      new BasicGeoposition() {Longitude=centerLongitude-0.001, Latitude=centerLatitude-0.0010},
      new BasicGeoposition() {Longitude=centerLongitude-0.001, Latitude=centerLatitude-0.0030},
      new BasicGeoposition() {Longitude=centerLongitude+0.001, Latitude=centerLatitude-0.0030},
      new BasicGeoposition() {Longitude=centerLongitude+0.001, Latitude=centerLatitude-0.0010},              
  });
  mapPolygon.ZIndex = 1;
  mapPolygon.FillColor = Colors.Orange;
  mapPolygon.StrokeColor = Colors.Blue;
  mapPolygon.StrokeThickness = 2;
  mapPolygon.StrokeDashed = false;
  MainMap.MapElements.Add(mapPolygon);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/DOA6t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DOA6t.png" alt="enter image description here"></a></p>