Package georegression.struct.shapes
Class Quadrilateral_F32
java.lang.Object
georegression.struct.shapes.Quadrilateral_F32
- All Implemented Interfaces:
Serializable
@Generated("georegression.struct.shapes.Quadrilateral_F64")
public class Quadrilateral_F32
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:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionQuadrilateral_F32
(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) Quadrilateral_F32
(Point2D_F32 a, Point2D_F32 b, Point2D_F32 c, Point2D_F32 d) Quadrilateral_F32
(Point2D_F32 a, Point2D_F32 b, Point2D_F32 c, Point2D_F32 d, boolean copy) -
Method Summary
Modifier and TypeMethodDescriptionfloat
area()
Returns the area of this quadrilateralconvert
(@Nullable List<Point2D_F32> storage, boolean copy) Converts the polygon into a list.copy()
get
(int index) getLine
(int which, LineSegment2D_F32 storage) float
getSideLength
(int which) float
getSideLength2
(int which) boolean
isEquals
(Quadrilateral_F32 quad, float tol) Returns true if the two quadrilaterals are equal to each other to within tolerance.void
setTo
(Quadrilateral_F32 quad) void
setTo
(List<Point2D_F32> list) Sets the polygon to be the same as the list.toString()
void
zero()
Sets the value of all vertexes to be zero
-
Field Details
-
a
-
b
-
c
-
d
-
-
Constructor Details
-
Quadrilateral_F32
public Quadrilateral_F32() -
Quadrilateral_F32
-
Quadrilateral_F32
public Quadrilateral_F32(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) -
Quadrilateral_F32
-
Quadrilateral_F32
-
-
Method Details
-
zero
public void zero()Sets the value of all vertexes to be zero -
area
public float area()Returns the area of this quadrilateral- Returns:
- area
-
get
-
getLine
-
getSideLength
public float getSideLength(int which) -
getSideLength2
public float 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
-