Class Rectangle

java.lang.Object
eu.svjatoslav.sixth.e3d.geometry.Rectangle

public class Rectangle extends Object
Rectangle class.
  • Field Details

    • p1

      public Point2D p1
      Rectangle points.
    • p2

      public Point2D p2
      Rectangle points.
  • Constructor Details

    • Rectangle

      public Rectangle(double size)
      Creates new rectangle with given size. The rectangle will be centered at the origin. The rectangle will be square.
      Parameters:
      size - The size of the rectangle.
    • Rectangle

      public Rectangle(Point2D p1, Point2D p2)
      Parameters:
      p1 - The first point of the rectangle.
      p2 - The second point of the rectangle.
  • Method Details

    • getHeight

      public double getHeight()
    • getLowerX

      public double getLowerX()
      Returns:
      The leftmost x coordinate of the rectangle.
    • getLowerY

      public double getLowerY()
    • getWidth

      public double getWidth()
      Returns:
      rectangle width.