georegression.struct.shapes
Class Polygon2D_F32
- java.lang.Object
-
- georegression.struct.shapes.Polygon2D_F32
-
- All Implemented Interfaces:
- java.io.Serializable
public class Polygon2D_F32 extends java.lang.Object implements java.io.SerializableDescribes a polygon in 2D.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description FastQueue<Point2D_F32>vertexes
-
Constructor Summary
Constructors Constructor and Description Polygon2D_F32()Polygon2D_F32(float... points)Polygon2D_F32(int numVertexes)Polygon2D_F32(Polygon2D_F32 a)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description floatareaSimple()Returns the area for simply polygons.Polygon2D_F32copy()voidflip()Point2D_F32get(int index)LineSegment2D_F32getLine(int index, LineSegment2D_F32 storage)Returns the line/edge defined by vertex index and index+1.booleanisCCW()true if the order of vertexes is in counter clockwise order.booleanisConvex()booleanisEquivalent(Polygon2D_F32 a, float tol)booleanisIdentical(Polygon2D_F32 a, float tol)booleanisInside(Point2D_F32 p)Returns true if the point is inside the polygon.voidset(int index, float x, float y)voidset(Polygon2D_F32 orig)intsize()java.lang.StringtoString()
-
-
-
Field Detail
-
vertexes
public FastQueue<Point2D_F32> vertexes
-
-
Constructor Detail
-
Polygon2D_F32
public Polygon2D_F32(Polygon2D_F32 a)
-
Polygon2D_F32
public Polygon2D_F32(int numVertexes)
-
Polygon2D_F32
public Polygon2D_F32(float... points)
-
Polygon2D_F32
public Polygon2D_F32()
-
-
Method Detail
-
set
public void set(Polygon2D_F32 orig)
-
set
public void set(int index, float x, float y)
-
get
public Point2D_F32 get(int index)
-
size
public int size()
-
copy
public Polygon2D_F32 copy()
-
areaSimple
public float areaSimple()
Returns the area for simply polygons. Non-self intersecting convex or concave.- Returns:
- area
-
isInside
public boolean isInside(Point2D_F32 p)
Returns true if the point is inside the polygon. Points along the border are ambiguously considered inside or outside.- Parameters:
p- A point- Returns:
- true if inside and false if outside
- See Also:
Intersection2D_F32.containConcave(Polygon2D_F32, Point2D_F32),Intersection2D_F32.containConcave(Polygon2D_F32, Point2D_F32)
-
isCCW
public boolean isCCW()
true if the order of vertexes is in counter clockwise order.- Returns:
- true if ccw or false if cw
-
isConvex
public boolean isConvex()
-
isIdentical
public boolean isIdentical(Polygon2D_F32 a, float tol)
-
isEquivalent
public boolean isEquivalent(Polygon2D_F32 a, float tol)
-
flip
public void flip()
-
getLine
public LineSegment2D_F32 getLine(int index, LineSegment2D_F32 storage)
Returns the line/edge defined by vertex index and index+1.- Parameters:
index- Index of the line- Returns:
- A new instance of the line segment.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG