Class RectangleLength2D_F32

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

@Generated("georegression.struct.shapes.RectangleLength2D_F64") public class RectangleLength2D_F32 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 float x0
      Lower extent x-axis
    • y0

      public float y0
      Lower extent y-axis
    • width

      public float width
      Rectangle's width
    • height

      public float height
      Rectangle's height
  • Constructor Details

    • RectangleLength2D_F32

      public RectangleLength2D_F32()
    • RectangleLength2D_F32

      public RectangleLength2D_F32(float x0, float y0, float width, float height)
  • Method Details

    • setTo

      public RectangleLength2D_F32 setTo(float x0, float y0, float width, float height)
    • setTo

    • setLowerExtent

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

      public Point2D_F32 getCorner(int index, @Nullable @Nullable Point2D_F32 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 float getX()
    • getY

      public float getY()
    • toString

      public String toString()
      Overrides:
      toString in class Object