title: Rotating Image (getting it back to original position)
body: <p>Using "Affine Transformation" I can rotate <code>imageA</code> easily. As well, <code>imageA</code> will move along with <code>imageB</code>.  However, I cannot seem to find a way to move <code>imageA</code> back to its original position after I have rotated it. </p>
  
  <p>(I have done some research on some sites and apparently the best method is to move the image back to its original position so that it looks like its rotating from an anchor point.)</p>
  
  <p>Heres my code so far:</p>
  
  <pre><code>public void paintComponent(Graphics g) {
      super.paintComponent(g);
      AffineTransform af = new AffineTransform();
      Graphics2D g2d = (Graphics2D) g;
  
  
      af.translate(imageBx, imageBy); // moves ImageA to imageb's position
      af.rotate(Math.toRadians(angle), imageB.getHeight(this) / 2, imageB.getWidth(this) / 2);
  
  
      g2d.drawImage(imageA, af, null);
      g2d.drawImage(imageB, imageBx, imageBy, null);
    }
  </code></pre>
  
  <p>If anyone can help me move <code>imageA</code> back to its original position (which is right on <code>imageB</code>) that would extremely helpful! </p>