src/main/java/de/javagl/geom/Points.java
/**
     * Compute the bounding box of the given points
     * 
     * @param points The input points
     * @return The bounding box of the given points
     */
Compute the bounding box of the given points

@param points The input points
@return The bounding box of the given points
Compute the bounding box of the given points @param points The input points @return The bounding box of the given points
public static Rectangle2D computeBounds(
        Iterable<? extends Point2D> points)
    {
        double minX = Double.MAX_VALUE;
        double minY = Double.MAX_VALUE;
        double maxX = -Double.MAX_VALUE;
        double maxY = -Double.MAX_VALUE;
        for (Point2D p : points)
        {
            double x = p.getX();
            double y = p.getY();
            minX = Math.min(minX, x);
            minY = Math.min(minY, y);
            maxX = Math.max(maxX, x);
            maxY = Math.max(maxY, y);
        }
        return new Rectangle2D.Double(minX, minY, maxX-minX, maxY-minY);
    }
public static Rectangle2D computeBounds ( Iterable < ? extends Point2D > points ) { double minX = Double . MAX_VALUE ; double minY = Double . MAX_VALUE ; double maxX = - Double . MAX_VALUE ; double maxY = - Double . MAX_VALUE ; for ( Point2D p : points ) { double x = p . getX ( ) ; double y = p . getY ( ) ; minX = Math . min ( minX , x ) ; minY = Math . min ( minY , y ) ; maxX = Math . max ( maxX , x ) ; maxY = Math . max ( maxY , y ) ; } return new Rectangle2D . Double ( minX , minY , maxX - minX , maxY - minY ) ; }
Compute the bounding box of the given points
Compute the bounding box of the given points