public class BoundingBox
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
xMax
the rightmost coordinate.
|
double |
xMin
the leftmost coordinate.
|
double |
yMax
the topmost coordinate.
|
double |
yMin
the bottommost coordinate.
|
Constructor and Description |
---|
BoundingBox()
Initializes a bounding box by setting all coordinates to zero.
|
BoundingBox(double xMin,
double yMin,
double xMax,
double yMax)
Initializes a bounding box with the bottom left and top right coordinates
|
Modifier and Type | Method and Description |
---|---|
void |
extendBoundingBox(BoundingBox b)
Extends the current bounding box to the minimal bounding box including both this bounding box and the bounding box in parameter.
|
double |
getHeight()
Gets the height of the bounding box.
|
double |
getWidth()
Gets the width of the bounding box.
|
java.lang.String |
toString() |
public double xMin
public double xMax
public double yMin
public double yMax
public BoundingBox(double xMin, double yMin, double xMax, double yMax)
xMin
- leftmost coordinateyMin
- bottommost coordinatexMax
- rightmost coordinateyMax
- topmost coordinatepublic BoundingBox()
public void extendBoundingBox(BoundingBox b)
b
- the bounding box to include.public double getWidth()
public double getHeight()
public java.lang.String toString()
toString
in class java.lang.Object