title: Rotating a polygon distorts the original shape
body: <p>When my polygon <strong>initially</strong> gets drawn after coming in contact with a 'Tag', it's <strong>drawn fine</strong> with the appropriate size and angles. However, <strong>when I rotate it, it gets distorted</strong> for eg. a right-angled triangle becomes an acute-like triangle.</p>
  
  <p>So I have a feeling something is wrong with the <strong>RotateTransform</strong> bit I'm doing but I can't figure out what.</p>
  
  <p><a href="https://i.stack.imgur.com/0j54G.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0j54G.jpg" alt="Original triangle drawn"></a></p>
  
  <p><a href="https://i.stack.imgur.com/O5MRS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O5MRS.jpg" alt="Rotated triangle drawn"></a></p>
  
  <p>Here is my code for initializing values and rotating a polygon:</p>
  
  <pre><code>public Tangible(Point topLeft, Point topRight, Point bottomLeft, Point bottomRight, Point centerOfTag, BlobPair taglocation, String name, Double tagAngleOffset, String colour, String shapeType)
      {
          TopLeft = topLeft;
          TopRight = topRight;
          BottomLeft = bottomLeft;
          BottomRight = bottomRight;
          TagLocation = taglocation;
          Name = name;
          CenterOfTag = centerOfTag;
          TagAngleOffset = tagAngleOffset;
          Colour = colour;
          ShapeType = shapeType;
      }
  public void draw (Canvas tagCanvas)
      {
          shapeOutline = new Polygon();
  
          //some other bits and pieces of code here
      }
  
  public void update(Canvas tagCanvas)
      {
          Double width = BottomRight.X - BottomLeft.X;
          Double height = BottomLeft.Y - TopLeft.Y;
          Double shapeOutlineCentreX = TopLeft.X + (width / 2.0);
          Double shapeOutlineCentreY = TopLeft.Y + (height / 2.0);
          Double TagCentreOffsetX = CenterOfTag.X - shapeOutlineCentreX;
          Double TagCentreOffsetY = CenterOfTag.Y - shapeOutlineCentreY;
  
          Point position = TagLocation.BigBlob.GetCenterPosition(tagCanvas);
          Point otherPosition = TagLocation.SmallBlob.GetCenterPosition(tagCanvas);
          Vector v = otherPosition - position;
          Point centerPoint = position + v / 2;
          Double trigCenterX = CenterOfTag.X - TopLeft.X;
          Double trigCenterY = CenterOfTag.Y - TopLeft.Y;
  
          **shapeOutline.RenderTransform = new RotateTransform(Math.Atan2(v.Y, v.X) * 180 / Math.PI - TagAngleOffset, trigCenterX, trigCenterY);**
  
          shapeOutline.SetValue(Canvas.LeftProperty, centerPoint.X - (width / 2.0) - TagCentreOffsetX);
          shapeOutline.SetValue(Canvas.TopProperty, centerPoint.Y - (height / 2.0) - TagCentreOffsetY);
  }
  </code></pre>