Package georegression.struct.shapes
Class RectangleLength2D_F64
java.lang.Object
georegression.struct.shapes.RectangleLength2D_F64
- All Implemented Interfaces:
Serializable
An axis aligned rectangle in 2D that is specified by its lower extent (x0,y0), width, and height. The three other corners are (x0 + width,y0), (x0,y0 + height), (x0 + width,y0 + height).
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCorner
(int index, @Nullable Point2D_F64 corner) Provides access to corners in the order specified below.double
getX()
double
getY()
void
setLowerExtent
(double x, double y) Sets lower extentsetTo
(double x0, double y0, double width, double height) Sets this rectangle to be equal to the passed in rectangle.toString()
void
zero()
Sets the value of all fields to zero
-
Field Details
-
x0
public double x0Lower extent x-axis -
y0
public double y0Lower extent y-axis -
width
public double widthRectangle's width -
height
public double heightRectangle's height
-
-
Constructor Details
-
RectangleLength2D_F64
public RectangleLength2D_F64() -
RectangleLength2D_F64
public RectangleLength2D_F64(double x0, double y0, double width, double height)
-
-
Method Details
-
setTo
-
setTo
-
setLowerExtent
public void setLowerExtent(double x, double y) Sets lower extent- Parameters:
x
- x-coordinatey
- y-coordinate
-
getCorner
Provides access to corners in the order specified below.[0] = (x0, y0) [1] = (x0 + w, y0) [2] = (x0 + w, y0 + h) [3] = (x0, y0 + h)
where w = width, and h = height.- Parameters:
index
- Which cornercorner
- (Optional) storage for the corner- Returns:
- The corner
-
setTo
Sets this rectangle to be equal to the passed in rectangle.- Parameters:
r
- Rectangle which this is to be set equal to
-
zero
public void zero()Sets the value of all fields to zero -
getX
public double getX() -
getY
public double getY() -
toString
-