Class BoundingBox2D
java.lang.Object
org.episteme.core.mathematics.geometry.boundaries.BoundingBox2D
- All Implemented Interfaces:
Serializable, BoundingBox<Point2D>
Axis-aligned bounding box in 2D.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBoundingBox2D(Point2D min, Point2D max) Creates a bounding box from min and max corners.BoundingBox2D(Real minX, Real minY, Real maxX, Real maxY) Creates a bounding box from coordinate values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if a point is within this bounding box.static BoundingBox2DfromPoints(List<Point2D> points) Creates a bounding box enclosing all points.getArea()Returns the area.Returns the center point.Returns the height (y extent).getMax()Returns the maximum corner of the bounding box.getMin()Returns the minimum corner of the bounding box.getWidth()Returns the width (x extent).Expands this bounding box to include a point.booleanintersects(BoundingBox<Point2D> other) Checks if this box intersects with another.merge(BoundingBox<Point2D> other) Merges this bounding box with another.toString()
-
Constructor Details
-
BoundingBox2D
-
BoundingBox2D
-
-
Method Details
-
fromPoints
Creates a bounding box enclosing all points.- Parameters:
points- the points to enclose- Returns:
- the bounding box
-
getMin
Description copied from interface:BoundingBoxReturns the minimum corner of the bounding box.- Specified by:
getMinin interfaceBoundingBox<Point2D>- Returns:
- the min point
-
getMax
Description copied from interface:BoundingBoxReturns the maximum corner of the bounding box.- Specified by:
getMaxin interfaceBoundingBox<Point2D>- Returns:
- the max point
-
getWidth
-
getHeight
-
getCenter
-
getArea
-
contains
Description copied from interface:BoundingBoxChecks if a point is within this bounding box.- Specified by:
containsin interfaceBoundingBox<Point2D>- Parameters:
point- the point to check- Returns:
- true if contained
-
intersects
Description copied from interface:BoundingBoxChecks if this box intersects with another.- Specified by:
intersectsin interfaceBoundingBox<Point2D>- Parameters:
other- the other bounding box- Returns:
- true if boxes overlap
-
include
Description copied from interface:BoundingBoxExpands this bounding box to include a point.- Specified by:
includein interfaceBoundingBox<Point2D>- Parameters:
point- the point to include- Returns:
- expanded bounding box
-
merge
Description copied from interface:BoundingBoxMerges this bounding box with another.- Specified by:
mergein interfaceBoundingBox<Point2D>- Parameters:
other- the other box- Returns:
- merged bounding box
-
toString
-