Package inra.ijpb.geometry
Class OrientedBox2D
java.lang.Object
inra.ijpb.geometry.OrientedBox2D
public class OrientedBox2D
extends java.lang.Object
An oriented Box in 2 dimensions, used to store results of oriented bounding box.
- Author:
- dlegland
-
Constructor Summary
Constructors Constructor Description OrientedBox2D(double xc, double yc, double length, double width, double orientation)
Default constructor for OrientedBox2D, that specifies center as two coordinates.OrientedBox2D(java.awt.geom.Point2D center, double length, double width, double orientation)
Default constructor for OrientedBox2D. -
Method Summary
Modifier and Type Method Description double
area()
Computes the area of this box.java.awt.geom.Point2D
center()
double
length()
double
orientation()
double
width()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OrientedBox2D
public OrientedBox2D(java.awt.geom.Point2D center, double length, double width, double orientation)Default constructor for OrientedBox2D.- Parameters:
center
- the center of the boxlength
- the box lengthwidth
- the box widthorientation
- the orientation of the box, in degrees counter-clockwise
-
OrientedBox2D
public OrientedBox2D(double xc, double yc, double length, double width, double orientation)Default constructor for OrientedBox2D, that specifies center as two coordinates.- Parameters:
xc
- the x-coordinate of the box centeryc
- the y-coordinate of the box centerlength
- the box lengthwidth
- the box widthorientation
- the orientation of the box, in degrees counter-clockwise
-
-
Method Details
-
area
public double area()Computes the area of this box.- Returns:
- the area of the box.
-
center
public java.awt.geom.Point2D center()- Returns:
- the center of the box
-
length
public double length()- Returns:
- the length of the box
-
width
public double width()- Returns:
- the width of the box
-
orientation
public double orientation()- Returns:
- the orientation of the box, in degrees
-