Package georegression.struct.shapes
Class Rectangle2D_F32
java.lang.Object
georegression.struct.shapes.Rectangle2D_F32
- All Implemented Interfaces:
Serializable
@Generated("georegression.struct.shapes.Rectangle2D_F64")
public class Rectangle2D_F32
extends Object
implements Serializable
An axis aligned rectangle in 2D that is specified by its lower-extent p0, and upper-extent p1.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
area()
void
Makes sure x0,y0 is the lower extent and x1,y1 is the upper extentboolean
getCorner
(int index, @Nullable Point2D_F32 corner) Provides access to corners in the order specified below.float
float
getWidth()
int
hashCode()
boolean
isEquals
(float x0, float y0, float x1, float y1, float tol) Returns true if all the extents are within tolerance.boolean
isEquals
(Rectangle2D_F32 r, float tol) Returns true if all the extents are within tolerance.setTo
(float x0, float y0, float x1, float y1) setTo
(Rectangle2D_F32 orig) toString()
void
zero()
Sets the value of all fields to zero
-
Field Details
-
p0
Lower extent -
p1
Upper extent
-
-
Constructor Details
-
Rectangle2D_F32
public Rectangle2D_F32(float x0, float y0, float x1, float y1) -
Rectangle2D_F32
-
Rectangle2D_F32
public Rectangle2D_F32()
-
-
Method Details
-
setTo
-
setTo
-
zero
public void zero()Sets the value of all fields to zero -
enforceExtents
public void enforceExtents()Makes sure x0,y0 is the lower extent and x1,y1 is the upper extent -
getCorner
Provides 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 cornercorner
- (Optional) storage for the corner- Returns:
- The corner
-
isEquals
Returns true if all the extents are within tolerance.- Parameters:
r
- Rectangletol
- tolerance for equality. To be equal the difference must be less than or equal to this- Returns:
- true if equal or false if not
-
isEquals
public boolean isEquals(float x0, float y0, float x1, float y1, float tol) Returns true if all the extents are within tolerance.- Parameters:
x0
- lower extent. x-axisy0
- lower extent. y-axisx1
- upper extent. x-axisy1
- upper extent. y-axistol
- tolerance for equality. To be equal the difference must be less than or equal to this- Returns:
- true if equal or false if not
-
getWidth
public float getWidth() -
getHeight
public float getHeight() -
area
public float area() -
toString
-
equals
-
hashCode
public int hashCode()
-