      * center.  The result is the smallest rectangle with integral coordinates
      * that can entirely contain the input rectangle.
      *
-     * @param rect    The rectangle-like object to round.
-     * @param out     An optional instance to store the result in.  If not
-     *                provided, a new Rectangle is created.
-     *
-     * @return  The object containing the rectangle with integral coordinates.
+     * @param rect
+     * The rectangle-like object to round.
+     *
+     * @param outRect
+     * An optional instance to store the result in.  If not provided, a new
+     * Rectangle is created.
+     *
+     * @return
+     * The object containing the rectangle with integral coordinates.
      */
     public static function roundOut(
-        rect:*, out:* = null):*
-    {
-        if (!out) out = new Rectangle();
+        rect:*, outRect:* = null):*
+    {
+        if (!outRect) outRect = new Rectangle();
 
         var r:Number = rect.x + rect.width;
         var b:Number = rect.y + rect.height;
 
-        out.x = Math.floor(rect.x);
-        out.y = Math.floor(rect.y);
-        out.width = Math.ceil(r) - out.x;
-        out.height = Math.ceil(b) - out.y;
-        return out;
+        outRect.x = Math.floor(rect.x);
+        outRect.y = Math.floor(rect.y);
+        outRect.width = Math.ceil(r) - outRect.x;
+        outRect.height = Math.ceil(b) - outRect.y;
+        return outRect;
     }
 
 

     * with the restriction that its <code>b</code> and <code>c</code>
     * properties are fixed at zero.
     *
     * @param rect     The rectangle-like object to transform.
     * @param xFactor  The number to multiply the x and width by.  This is
     *                 equivalent to a Matrix's <code>a</code> property.
     * @param yFactor  The number to multiply the y and height by.  This is
     *                 equivalent to a Matrix's <code>d</code> property.
     * @param xOffset  The number to add to the resultant x.  This is
     *                 equivalent to a Matrix's <code>tx</code> property.
     * @param yOffset  The number to add to the resultant y.  This is
     *                 equivalent to a Matrix's <code>ty</code> property.
     * @param out      An optional instance to store the result in.  If not
     *                 provided, a new Rectangle is created.
     *
     * @return  The object containing the transformed rectangle.
     */
    public static function transform(
        rect:*,
        xFactor:Number, yFactor:Number,
        xOffset:Number, yOffset:Number,
        out:* = null):*
    {
        if (!out) out = new Rectangle();
        out.x = rect.x * xFactor + xOffset;
        out.y = rect.y * yFactor + yOffset;
        out.width = rect.width * xFactor;
        out.height = rect.height * yFactor;
        return out;
    }



     * Scales a source rectangle to fit or fill a target rectangle, maintaining
     * the source rectangle's aspect ratio.
     *
     * @param sourceRect
     * The source rectangle.
     *
     * @param targetRect
     * The rectangle to fit <code>sourceRect</code> into.
     *
     * @param mode
     * Fit mode. <code>FitMode.INSIDE</code> returns a rectangle that
     * fits entirely within the target rectangle, <code>FitMode.OUTSIDE</code>
     * returns a rectangle that covers the entirety of the target rectangle.
     *
     * @param xAlign
     * X alignment. A number from 0 to 1. 0 aligns left edges, 1 aligns right
     * edges, and 0.5 centres horizontally. Other values interpolate between
     * these values.
     *
     * @param yAlign
     * Y alignment. A number from 0 to 1. 0 aligns top edges, 1 aligns bottom
     * edges, and 0.5 centres vertically. Other values interpolate between
     * these values.
     *
     * @param rounding
     * Rounds the calculated values of <code>x</code>, <code>y</code>,
     * <code>width</code> and <code>height</code> to the nearest whole number.
     *
     * @param outRect
     * An optional instance to store the result in.  If not provided, a new
     * Rectangle is created.
     *
     * @return
     * The object containing the result of fitting <code>sourceRect</code> to
     * <code>targetRect</code>.
     */
    public static function fit(
        sourceRect:*, targetRect:*,
        fitMode:String,
        xAlign:Number = 0.5, yAlign:Number = 0.5,
        rounding:Boolean = false,
        outRect:* = null):*
    {
        // copy values to guard against aliasing
        var sw:Number = sourceRect.width, sh:Number = sourceRect.height;
        var tw:Number = targetRect.width, th:Number = targetRect.height;

        var scale:Number;

        if (!outRect) outRect = new Rectangle();

        if (fitMode == FitMode.OUTSIDE)
        {
