Package georegression.struct.shapes
Class Rectangle2D_F64
java.lang.Object
georegression.struct.shapes.Rectangle2D_F64
- All Implemented Interfaces:
- Serializable
An axis aligned rectangle in 2D that is specified by its lower-extent p0, and upper-extent p1.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondoublearea()voidMakes sure x0,y0 is the lower extent and x1,y1 is the upper extentbooleangetCorner(int index, @Nullable Point2D_F64 corner) Provides access to corners in the order specified below.doubledoublegetWidth()inthashCode()booleanisEquals(double x0, double y0, double x1, double y1, double tol) Returns true if all the extents are within tolerance.booleanisEquals(Rectangle2D_F64 r, double tol) Returns true if all the extents are within tolerance.setTo(double x0, double y0, double x1, double y1) setTo(Rectangle2D_F64 orig) toString()voidzero()Sets the value of all fields to zero
- 
Field Details- 
p0Lower extent
- 
p1Upper extent
 
- 
- 
Constructor Details- 
Rectangle2D_F64public Rectangle2D_F64(double x0, double y0, double x1, double y1) 
- 
Rectangle2D_F64
- 
Rectangle2D_F64public Rectangle2D_F64()
 
- 
- 
Method Details- 
setTo
- 
setTo
- 
zeropublic void zero()Sets the value of all fields to zero
- 
enforceExtentspublic void enforceExtents()Makes sure x0,y0 is the lower extent and x1,y1 is the upper extent
- 
getCornerProvides access to corners in the order specified below.
 [0] = (p0.x, p0.y) [1] = (p1.x, p0.y) [2] = (p1.x, p1.y) [3] = (p0.x, p1.y) - Parameters:
- index- Which corner
- corner- (Optional) storage for the corner
- Returns:
- The corner
 
- 
isEqualsReturns true if all the extents are within tolerance.- Parameters:
- r- Rectangle
- tol- tolerance for equality. To be equal the difference must be less than or equal to this
- Returns:
- true if equal or false if not
 
- 
isEqualspublic boolean isEquals(double x0, double y0, double x1, double y1, double tol) Returns true if all the extents are within tolerance.- Parameters:
- x0- lower extent. x-axis
- y0- lower extent. y-axis
- x1- upper extent. x-axis
- y1- upper extent. y-axis
- tol- tolerance for equality. To be equal the difference must be less than or equal to this
- Returns:
- true if equal or false if not
 
- 
getWidthpublic double getWidth()
- 
getHeightpublic double getHeight()
- 
areapublic double area()
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-