src/main/java/de/javagl/geom/Rectangles.java
/**
     * Scale the given rectangle by the given factor, about its center,
     * and store the result in the given result rectangle.<br>
     * <br>
     * If the given result rectangle is <code>null</code>, then a new 
     * rectangle will be created and returned.
     * 
     * @param r The rectangle
     * @param factor The scaling factor
     * @param result The rectangle that will store the result
     * @return The result rectangle
     */
Scale the given rectangle by the given factor, about its center,
and store the result in the given result rectangle.

If the given result rectangle is null, then a new
rectangle will be created and returned.

@param r The rectangle
@param factor The scaling factor
@param result The rectangle that will store the result
@return The result rectangle
Scale the given rectangle by the given factor about its center and store the result in the given result rectangle . If the given result rectangle is null then a new rectangle will be created and returned . @param r The rectangle @param factor The scaling factor @param result The rectangle that will store the result @return The result rectangle
public static Rectangle2D scale(
        Rectangle2D r, double factor, Rectangle2D result)
    {
        if (result == null)
        {
            result = new Rectangle2D.Double();
        }
        double w = factor * r.getWidth();
        double h = factor * r.getHeight();
        result.setRect(
            r.getCenterX() - w * 0.5, 
            r.getCenterY() - h * 0.5, 
            w, h);
        return r;
    }
public static Rectangle2D scale ( Rectangle2D r , double factor , Rectangle2D result ) { if ( result == null ) { result = new Rectangle2D . Double ( ) ; } double w = factor * r . getWidth ( ) ; double h = factor * r . getHeight ( ) ; result . setRect ( r . getCenterX ( ) - w * 0.5 , r . getCenterY ( ) - h * 0.5 , w , h ) ; return r ; }
Scale the given rectangle by the given factor, about its center,
 and store the result in the given result rectangle.<br>
 <br>
 If the given result rectangle is <code>null</code>, then a new
 rectangle will be created and returned.
Scale the given rectangle by the given factor about its center and store the result in the given result rectangle . <br > <br > If the given result rectangle is <code > null< / code > then a new rectangle will be created and returned .