Package georegression.struct.shapes
Class Quadrilateral_F64
java.lang.Object
georegression.struct.shapes.Quadrilateral_F64
- All Implemented Interfaces:
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionQuadrilateral_F64(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3) Quadrilateral_F64(Point2D_F64 a, Point2D_F64 b, Point2D_F64 c, Point2D_F64 d) Quadrilateral_F64(Point2D_F64 a, Point2D_F64 b, Point2D_F64 c, Point2D_F64 d, boolean copy) -
Method Summary
Modifier and TypeMethodDescriptiondoublearea()Returns the area of this quadrilateralconvert(@Nullable List<Point2D_F64> storage, boolean copy) Converts the polygon into a list.copy()get(int index) getLine(int which, LineSegment2D_F64 storage) doublegetSideLength(int which) doublegetSideLength2(int which) booleanisEquals(Quadrilateral_F64 quad, double tol) Returns true if the two quadrilaterals are equal to each other to within tolerance.voidsetTo(Quadrilateral_F64 quad) voidsetTo(List<Point2D_F64> list) Sets the polygon to be the same as the list.toString()voidzero()Sets the value of all vertexes to be zero
-
Field Details
-
a
-
b
-
c
-
d
-
-
Constructor Details
-
Quadrilateral_F64
public Quadrilateral_F64() -
Quadrilateral_F64
-
Quadrilateral_F64
public Quadrilateral_F64(double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3) -
Quadrilateral_F64
-
Quadrilateral_F64
-
-
Method Details
-
zero
public void zero()Sets the value of all vertexes to be zero -
area
public double area()Returns the area of this quadrilateral- Returns:
- area
-
get
-
getLine
-
getSideLength
public double getSideLength(int which) -
getSideLength2
public double getSideLength2(int which) -
setTo
-
convert
Converts the polygon into a list.- Parameters:
storage- (Optional) storage to put the vertexes intocopy- If points will be copied otherwise a reference of points will be returned- Returns:
- List of vertexes
-
setTo
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
-
isEquals
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 quadrilateraltol- Maximum allowed distance between vertexes.- Returns:
- true if equals or false if not
-
toString
-