private void updateBounds ( ) { if ( npoints >= MIN_POINTS ) { double boundsMinX = Double . MAX_VALUE ; double boundsMinY = Double . MAX_VALUE ; double boundsMaxX = - Double . MAX_VALUE ; double boundsMaxY = - Double . MAX_VALUE ; for ( int i = 0 ; i < npoints ; i ++ ) { final double x = xpoints [ i ] ; boundsMinX = Math . min ( boundsMinX , x ) ; boundsMaxX = Math . max ( boundsMaxX , x ) ; final double y = ypoints [ i ] ; boundsMinY = Math . min ( boundsMinY , y ) ; boundsMaxY = Math . max ( boundsMaxY , y ) ; } bounds . set ( boundsMinX , boundsMinY , boundsMaxX - boundsMinX , boundsMaxY - boundsMinY ) ; } }
Update the bounds .