Class Rectangle2D_F64

java.lang.Object
georegression.struct.shapes.Rectangle2D_F64
All Implemented Interfaces:
Serializable

public class Rectangle2D_F64 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 Details

  • Constructor Details

    • Rectangle2D_F64

      public Rectangle2D_F64(double x0, double y0, double x1, double y1)
    • Rectangle2D_F64

      public Rectangle2D_F64(Rectangle2D_F64 orig)
    • Rectangle2D_F64

      public Rectangle2D_F64()
  • Method Details

    • setTo

      public Rectangle2D_F64 setTo(Rectangle2D_F64 orig)
    • setTo

      public Rectangle2D_F64 setTo(double x0, double y0, double x1, double y1)
    • 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
    • isEquals

      public boolean isEquals(Rectangle2D_F64 r, double tol)
      Returns 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
    • isEquals

      public 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
    • getWidth

      public double getWidth()
    • getHeight

      public double getHeight()
    • area

      public double area()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object