Class Quadrilateral_F64

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

public class Quadrilateral_F64
extends Object
implements Serializable
A polygon with 4 vertices, a,b,c, and d. The vertices are in order sequential order of a,b,c,d.
See Also:
Serialized Form
  • Field Details

  • Constructor Details

  • Method Details

    • area

      public double area()
      Returns the area of this quadrilateral
      Returns:
      area
    • get

      public Point2D_F64 get​(int index)
    • getA

      public Point2D_F64 getA()
    • setA

      public void setA​(Point2D_F64 a)
    • getB

      public Point2D_F64 getB()
    • setB

      public void setB​(Point2D_F64 b)
    • getC

      public Point2D_F64 getC()
    • setC

      public void setC​(Point2D_F64 c)
    • getD

      public Point2D_F64 getD()
    • setD

      public void setD​(Point2D_F64 d)
    • getLine

      public LineSegment2D_F64 getLine​(int which, LineSegment2D_F64 storage)
    • getSideLength

      public double getSideLength​(int which)
    • getSideLength2

      public double getSideLength2​(int which)
    • setTo

      public void setTo​(Quadrilateral_F64 quad)
    • convert

      public List<Point2D_F64> convert​(@Nullable @Nullable List<Point2D_F64> storage, boolean copy)
      Converts the polygon into a list.
      Parameters:
      storage - (Optional) storage to put the vertexes into
      copy - If points will be copied otherwise a reference of points will be returned
      Returns:
      List of vertexes
    • setTo

      public void setTo​(List<Point2D_F64> list)
      Sets the polygon to be the same as the list. A true copy is created and no references to points in the list are saved.
      Parameters:
      list - List which the polygon will be set to
    • copy

      public Quadrilateral_F64 copy()
    • isEquals

      public boolean isEquals​(Quadrilateral_F64 quad, double tol)
      Returns true if the two quadrilaterals are equal to each other to within tolerance. Equality is defined by seeing if the distance between two equivalent vertexes is within tolerance.
      Parameters:
      quad - The second quadrilateral
      tol - Maximum allowed distance between vertexes.
      Returns:
      true if equals or false if not
    • toString

      public String toString()
      Overrides:
      toString in class Object