Class RectangleLength2D_F64

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

public class RectangleLength2D_F64 extends Object implements 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 Details

    • x0

      public double x0
      Lower extent x-axis
    • y0

      public double y0
      Lower extent y-axis
    • width

      public double width
      Rectangle's width
    • height

      public double height
      Rectangle'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

      public RectangleLength2D_F64 setTo(double x0, double y0, double width, double height)
    • setTo

    • setLowerExtent

      public void setLowerExtent(double x, double y)
      Sets lower extent
      Parameters:
      x - x-coordinate
      y - y-coordinate
    • getCorner

      public Point2D_F64 getCorner(int index, @Nullable @Nullable Point2D_F64 corner)
      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 corner
      corner - (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

      public String toString()
      Overrides:
      toString in class Object