Expand the current volume by the given point
@param pointX    x coordinate of point
@param pointY    y coordinate of point
@param pointZ    z coordinate of point
@return the updated BoundingVolume.
354872
public final BoundingVolume expandBoundingVolume(final float pointX, final float pointY, final float pointZ) {
        return new BoundingVolume(
                NativeSceneObject.expandBoundingVolumeByPoint(
                        getNative(), pointX, pointY, pointZ));
    }
1360232
public static double[] bbox(@NonNull Point point) {
    List<Point> resultCoords = TurfMeta.coordAll(point);
    return bboxCalculator(resultCoords);
  }
622662
def update(self, pointvol):
        """"""

        # Check if we should use the pool for updating.
        if self.use_pool_update:
            pool = self.pool
        else:
            pool = None

        # Update the bounding ellipsoids.
        self.mell.update(self.live_u, pointvol=pointvol,
                         vol_dec=self.vol_dec, vol_check=self.vol_check,
                         rstate=self.rstate, bootstrap=self.bootstrap,
                         pool=pool)
        if self.enlarge != 1.:
            self.mell.scale_to_vols(self.mell.vols * self.enlarge)

        return copy.deepcopy(self.mell)
967358
public void add(double x, double y, double z) {
		resize(m_pointCount + 1);
		Point3D pt = new Point3D();
		pt.setCoords(x, y, z);
		setXYZ(m_pointCount - 1, pt);
	}
475089
def mvee(points, tol=0.001):
    

    # This function is a port of the matlab function by
    # Nima Moshtagh found here:
    # https://www.mathworks.com/matlabcentral/fileexchange/9542-minimum-volume-enclosing-ellipsoid
    # with accompanying writup here:
    # https://www.researchgate.net/profile/Nima_Moshtagh/publication/254980367_MINIMUM_VOLUME_ENCLOSING_ELLIPSOIDS/links/54aab5260cf25c4c472f487a.pdf

    N, d = points.shape

    Q = np.zeros([N,d+1])
    Q[:,0:d] = points[0:N,0:d]
    Q[:,d] = np.ones([1,N])

    Q = np.transpose(Q)
    points = np.transpose(points)
    count = 1
    err = 1
    u = (1/N) * np.ones(shape = (N,))

    while err > tol:

        X = np.dot(np.dot(Q, np.diag(u)), np.transpose(Q))
        M = np.diag( np.dot(np.dot(np.transpose(Q), la.inv(X)),Q))
        jdx = np.argmax(M)
        step_size = (M[jdx] - d - 1)/((d+1)*(M[jdx] - 1))
        new_u = (1 - step_size)*u
        new_u[jdx] = new_u[jdx] + step_size
        count = count + 1
        err = la.norm(new_u - u)
        u = new_u

    U = np.diag(u)
    c = np.dot(points,u)
    A = (1/d) * la.inv(np.dot(np.dot(points,U), np.transpose(points)) - np.outer(c,c) )
    return A, np.transpose(c)
905921
public static BoundingBox getProjectedBoundingBox(Projection projection,
			long x, long y, int zoom) {

		BoundingBox boundingBox = getWebMercatorBoundingBox(x, y, zoom);

		if (projection != null) {
			ProjectionTransform transform = webMercator
					.getTransformation(projection);
			boundingBox = boundingBox.transform(transform);
		}

		return boundingBox;
	}
658318
public final BoundingVolume expandBoundingVolume(final Vector3f center, final float radius) {
        return expandBoundingVolume(center.x, center.y, center.z, radius);
    }
864776
static Point calculateCenterOfBoundingBox(Point[] coordinates) {
        double pointXMin = coordinates[0].x;
        double pointXMax = coordinates[0].x;
        double pointYMin = coordinates[0].y;
        double pointYMax = coordinates[0].y;

        for (Point immutablePoint : coordinates) {
            if (immutablePoint.x < pointXMin) {
                pointXMin = immutablePoint.x;
            } else if (immutablePoint.x > pointXMax) {
                pointXMax = immutablePoint.x;
            }

            if (immutablePoint.y < pointYMin) {
                pointYMin = immutablePoint.y;
            } else if (immutablePoint.y > pointYMax) {
                pointYMax = immutablePoint.y;
            }
        }

        return new Point((pointXMin + pointXMax) / 2, (pointYMax + pointYMin) / 2);
    }
1323899
public BBox calcBBox2D() {
        check("calcRouteBBox");
        BBox bounds = BBox.createInverse(false);
        for (int i = 0; i < pointList.getSize(); i++) {
            bounds.update(pointList.getLatitude(i), pointList.getLongitude(i));
        }
        return bounds;
    }
434779
@Override
	public void setXYZ(int index, Point3D pt) {
		if (index < 0 || index >= getPointCount())
			throw new IndexOutOfBoundsException();

		addAttribute(Semantics.Z);

		_verifyAllStreams();
		notifyModified(DirtyFlags.DirtyCoordinates);
		AttributeStreamOfDbl v = (AttributeStreamOfDbl) m_vertexAttributes[0];
		v.write(index * 2, pt.x);
		v.write(index * 2 + 1, pt.y);
		m_vertexAttributes[1].writeAsDbl(index, pt.z);
	}
1286029
public void addPoint( float x , float y , float z ) {
		norm.grow().set(x/z, y/z);
	}
1370686
public Vector3d positiveZ(Vector3d dir) {
        dir.x = m10 * m21 - m11 * m20;
        dir.y = m20 * m01 - m21 * m00;
        dir.z = m00 * m11 - m01 * m10;
        return dir.normalize(dir);
    }
283348
public static Geometry toPolygon(Bbox bounds) {
		double minX = bounds.getX();
		double minY = bounds.getY();
		double maxX = bounds.getMaxX();
		double maxY = bounds.getMaxY();

		Geometry polygon = new Geometry(Geometry.POLYGON, 0, -1);
		Geometry linearRing = new Geometry(Geometry.LINEAR_RING, 0, -1);

		linearRing.setCoordinates(new Coordinate[] { new Coordinate(minX, minY), new Coordinate(maxX, minY),
				new Coordinate(maxX, maxY), new Coordinate(minX, maxY), new Coordinate(minX, minY) });
		polygon.setGeometries(new Geometry[] { linearRing });
		return polygon;
	}
45723
def _build_mountpoint(self, volume):
        
        self.add_volume(self._build_volume(volume))
        return {
            'sourceVolume': self.path_to_name(volume.get('host')),
            'containerPath': volume.get('container')
        }
1220133
public int addPoint(double x, double y, int groupIndex) {
		final int groupCount = getGroupCount();

		if (groupIndex < 0) {
			throw new IndexOutOfBoundsException(groupIndex + "<0"); //$NON-NLS-1$
		}
		if (groupIndex >= groupCount) {
			throw new IndexOutOfBoundsException(groupIndex + ">=" + groupCount); //$NON-NLS-1$
		}

		int pointIndex;

		if (this.pointCoordinates == null) {
			this.pointCoordinates = new double[] {x, y};
			this.partIndexes = null;
			pointIndex = 0;
		} else {
			pointIndex = lastInGroup(groupIndex);
			double[] pts = new double[this.pointCoordinates.length + 2];

			pointIndex += 2;

			System.arraycopy(this.pointCoordinates, 0, pts, 0, pointIndex);
			System.arraycopy(this.pointCoordinates, pointIndex, pts, pointIndex + 2, this.pointCoordinates.length - pointIndex);
			pts[pointIndex] = x;
			pts[pointIndex + 1] = y;
			this.pointCoordinates = pts;
			pts = null;

			//Shift the following groups's indexes
			if (this.partIndexes != null) {
				for (int idx = groupIndex; idx < this.partIndexes.length; ++idx) {
					this.partIndexes[idx] += 2;
				}
			}

			pointIndex /= 2.;
		}

		fireShapeChanged();
		fireElementChanged();

		return pointIndex;
	}
1281628
public static double volume(SpatialComparable box) {
    final int dim = box.getDimensionality();
    double vol = 1.;
    for(int i = 0; i < dim; i++) {
      double delta = box.getMax(i) - box.getMin(i);
      if(delta == 0.) {
        return 0.;
      }
      vol *= delta;
    }
    return vol;
  }
1106798
public void expandBoundingBox(BoundingBox boundingBox) {

        switch (shapeType) {

            case LAT_LNG:
                expandBoundingBox(boundingBox, (LatLng) shape);
                break;
            case MARKER_OPTIONS:
                expandBoundingBox(boundingBox,
                        ((MarkerOptions) shape).getPosition());
                break;
            case POLYLINE_OPTIONS:
                expandBoundingBox(boundingBox,
                        ((PolylineOptions) shape).getPoints());
                break;
            case POLYGON_OPTIONS:
                expandBoundingBox(boundingBox, ((PolygonOptions) shape).getPoints());
                break;
            case MULTI_LAT_LNG:
                expandBoundingBox(boundingBox, ((MultiLatLng) shape).getLatLngs());
                break;
            case MULTI_POLYLINE_OPTIONS:
                MultiPolylineOptions multiPolylineOptions = (MultiPolylineOptions) shape;
                for (PolylineOptions polylineOptions : multiPolylineOptions
                        .getPolylineOptions()) {
                    expandBoundingBox(boundingBox, polylineOptions.getPoints());
                }
                break;
            case MULTI_POLYGON_OPTIONS:
                MultiPolygonOptions multiPolygonOptions = (MultiPolygonOptions) shape;
                for (PolygonOptions polygonOptions : multiPolygonOptions
                        .getPolygonOptions()) {
                    expandBoundingBox(boundingBox, polygonOptions.getPoints());
                }
                break;
            case MARKER:
                expandBoundingBox(boundingBox, ((Marker) shape).getPosition());
                break;
            case POLYLINE:
                expandBoundingBox(boundingBox, ((Polyline) shape).getPoints());
                break;
            case POLYGON:
                expandBoundingBox(boundingBox, ((Polygon) shape).getPoints());
                break;
            case MULTI_MARKER:
                expandBoundingBoxMarkers(boundingBox,
                        ((MultiMarker) shape).getMarkers());
                break;
            case MULTI_POLYLINE:
                MultiPolyline multiPolyline = (MultiPolyline) shape;
                for (Polyline polyline : multiPolyline.getPolylines()) {
                    expandBoundingBox(boundingBox, polyline.getPoints());
                }
                break;
            case MULTI_POLYGON:
                MultiPolygon multiPolygon = (MultiPolygon) shape;
                for (Polygon polygon : multiPolygon.getPolygons()) {
                    expandBoundingBox(boundingBox, polygon.getPoints());
                }
                break;
            case POLYLINE_MARKERS:
                expandBoundingBoxMarkers(boundingBox,
                        ((PolylineMarkers) shape).getMarkers());
                break;
            case POLYGON_MARKERS:
                expandBoundingBoxMarkers(boundingBox,
                        ((PolygonMarkers) shape).getMarkers());
                break;
            case MULTI_POLYLINE_MARKERS:
                MultiPolylineMarkers multiPolylineMarkers = (MultiPolylineMarkers) shape;
                for (PolylineMarkers polylineMarkers : multiPolylineMarkers
                        .getPolylineMarkers()) {
                    expandBoundingBoxMarkers(boundingBox,
                            polylineMarkers.getMarkers());
                }
                break;
            case MULTI_POLYGON_MARKERS:
                MultiPolygonMarkers multiPolygonMarkers = (MultiPolygonMarkers) shape;
                for (PolygonMarkers polygonMarkers : multiPolygonMarkers
                        .getPolygonMarkers()) {
                    expandBoundingBoxMarkers(boundingBox,
                            polygonMarkers.getMarkers());
                }
                break;
            case COLLECTION:
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape;
                for (GoogleMapShape shapeListItem : shapeList) {
                    shapeListItem.expandBoundingBox(boundingBox);
                }
                break;
        }

    }