src/main/java/de/javagl/geom/Rectangles.java
/**
     * Store the center of the given rectangle in the given point,
     * and return it.<br>
     * <br>
     * If the given point is <code>null</code>, then a new point
     * will be created and returned
     * 
     * @param r The rectangle
     * @param result The point that will store the result
     * @return The result
     */
Store the center of the given rectangle in the given point,
and return it.

If the given point is null, then a new point
will be created and returned

@param r The rectangle
@param result The point that will store the result
@return The result
Store the center of the given rectangle in the given point and return it . If the given point is null then a new point will be created and returned @param r The rectangle @param result The point that will store the result @return The result
public static Point2D center(Rectangle2D r, Point2D result)
    {
        if (result == null)
        {
            result = new Point2D.Double();
        }
        result.setLocation(r.getCenterX(), r.getCenterY());
        return result;
    }
public static Point2D center ( Rectangle2D r , Point2D result ) { if ( result == null ) { result = new Point2D . Double ( ) ; } result . setLocation ( r . getCenterX ( ) , r . getCenterY ( ) ) ; return result ; }
Store the center of the given rectangle in the given point,
 and return it.<br>
 <br>
 If the given point is <code>null</code>, then a new point
 will be created and returned
Store the center of the given rectangle in the given point and return it . <br > <br > If the given point is <code > null< / code > then a new point will be created and returned