* @see ca.eandb.jmist.framework.Bounded3#boundingSphere()
*/
public Sphere boundingSphere() {
List<Point3> points = new ArrayList<Point3>();
Box3 bounds = grid.getBoundingBox();
int nx = height.rows();
int nz = height.columns();
for (int ix = 0; ix < nx; ix++) {
double x = (double) ix / (double) (nx - 1);
for (int iz = 0; iz < nz; iz++) {
double z = (double) iz / (double) (nz - 1);
points.add(new Point3(bounds.interpolateX(x), height.at(ix, iz), bounds.interpolateZ(z)));
}
}
return Sphere.smallestContaining(points);