Class Box2D

java.lang.Object
inra.ijpb.geometry.Box2D

public class Box2D
extends java.lang.Object
A bounding Box in 2 dimensions.
Author:
dlegland
See Also:
Box3D
  • Constructor Summary

    Constructors
    Constructor Description
    Box2D​(double xmin, double xmax, double ymin, double ymax)
    Default constructor of the bounding box, that specifies the bounds along each dimension.
  • Method Summary

    Modifier and Type Method Description
    double area()
    Computes the area of this bounding box.
    double getXMax()  
    double getXMin()  
    double getYMax()  
    double getYMin()  
    double height()
    Computes the height of the bounding box, corresponding to the extent along the Y dimension.
    double width()
    Computes the width of the bounding box, corresponding to the extent along the X dimension.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Box2D

      public Box2D​(double xmin, double xmax, double ymin, double ymax)
      Default constructor of the bounding box, that specifies the bounds along each dimension.
      Parameters:
      xmin - the minimum x coordinate
      xmax - the maximum x coordinate
      ymin - the minimum y coordinate
      ymax - the maximum y coordinate
  • Method Details

    • area

      public double area()
      Computes the area of this bounding box.
      Returns:
      the area enclosed by the bounding box.
    • width

      public double width()
      Computes the width of the bounding box, corresponding to the extent along the X dimension.
      Returns:
      the width of the bounding box
    • height

      public double height()
      Computes the height of the bounding box, corresponding to the extent along the Y dimension.
      Returns:
      the height of the bounding box
    • getXMin

      public double getXMin()
      Returns:
      the minimum value along the X-axis.
    • getXMax

      public double getXMax()
      Returns:
      the maximum value along the X-axis.
    • getYMin

      public double getYMin()
      Returns:
      the minimum value along the Y-axis.
    • getYMax

      public double getYMax()
      Returns:
      the maximum value along the Y-axis.