Q:

Maximum bounding box of a shape from one AffineTransform to another

Summary
I'm trying to find the bounding box of a shape that is transformed between to transformation anchors. The goal is to encapsulate an animation of a rectangle so that none of the rectangle is ever outside the rendered area. I am using these three java classes:

java.awt.Rectangle
java.awt.geom.AffineTransform
Anchor (custom class) 

Currently What I Have
Here's how the anchor class is defined:
public class Anchor {
  public double deltaX = 0, deltaY = 0;
  public double scaleX = 1, scaleY = 1;
  public double degrees = 0;
}

In my real application, I have a set of anchors that are attached to a time, and as the animation progresses the shape is interpolated between the two neighboring "Anchors." But for this question we only need to worry about 2 Anchors.
Here's a crude, mostly working implementation of what I want, but I feel like there must be a more accurate, efficient mathematical approach. It's sloooooow thanks to having to make many steps. The more steps I iterate through, the better results, obviously.
public static Rectangle getBounds(Anchor leftAnchor, Anchor rightAnchor, int shapeWidth, int shapeHeight) {
  Rectangle baseShape = new Rectangle(0, 0, shapeWidth, shapeHeight); // the shape we draw in the animation
  Rectangle globalBounds = null, localBounds; // global bounds is the bounds of the whole animation
  for(double time = 0;time <= 1;time += 0.001) { // interpolate from one anchor to the next (1000 steps)
    // Create the transformation and find the finds of the resultant shape
    AffineTransform transformation = getInterpolatedTransformation(leftAnchor, rightAnchor, shapeWidth, shapeHeight, time);
    localBounds = transformation.createTransformedShape(baseShape).getBounds();
    if(globalBounds == null) // if it's the first step, create the initial bounds
      globalBounds = localBounds;
    else // otherwise continue adding bounds
      globalBounds.add(localBounds);
  }
  return globalBounds; // return the global bounds
}

public static AffineTransform getInterpolatedTransformation(Anchor left, Anchor right, int width, int height, double time) {
  // get the interpolated values from the two anchors
  double deltaX = linearInterpolation(left.deltaX, right.deltaX, time);
  double deltaY = linearInterpolation(left.deltaX, right.deltaX, time);
  double scaleX = linearInterpolation(left.scaleX, right.scaleX, time);
  double scaleY = linearInterpolation(left.scaleY, right.scaleY, time);
  double degrees = linearInterpolation(left.degrees, right.degrees, time);

  // Create the AffineTransformation based on the two interpolated acnhors
  AffineTransform transform = new AffineTransform();
  transform.translate(deltaX, deltaY);
  transform.scale(scaleX, scaleY);
  transform.rotate(Math.toRadians(degrees),
          scaleX*width/2.0+deltaX,
          scaleY*height/2.0+deltaY);

  return transform; // return it
}

The Big Question
Is there an efficient way to find the bounding box that contains every possible transformation of a rectangle that is interpolated between two Affine Transformations.
Notes
Originally my animation anchors did not have a degree defined. I could find the bounding box by simply adding the resulting bounding box of the left anchor's AffineTransform and the right anchor's AffineTransform. However, with rotation the points of the animated rectangle can escape these more easily found bounding boxes.
PS: To you C programmers, I apologise for my verboseness in my code...

A:

I had sent this Stack OVerflow to a friend for some advice.  He didn't have time to look at it then and there but he did send me this: The X & Y Problem. It may be possible to solve this math question, but I found a much better way to go about the solution.
I knew how many frames the animation would take place over (generating a GIF) so I was able to simply pre-calculate each frames' transformation - find the bounding box of all frames and then generate the output image correctly.

