code: function getMinMax() {
    var minPt = pts[0];
    var maxPt = pts[0];
    for (var i=1; i<pts.length; i++) {
      minPt = minPt.$min( pts[i] );
    }
    for (i=1; i<pts.length; i++) {
      maxPt = maxPt.$max( pts[i] );
    }
    nextRect.set( minPt).to( maxPt );
  }
docs: Calculate min and max points, and set the rectangular bound.