|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Polygon
This interface provides one special component that may appear on a graph: a polygon. The definition here is used loosely; there is no absolute or implied
requirement that the Polygon
not intersect itself, nor must it be closed. The Polygon class instead represents a two-dimensional collection of
line segments such that each shares at least one endpoint with another line segment and such that it may be drawn (rendered) as a consecutive and finite sequence
of points.
The critical components of a Polygon
are the points describing its vertices and whether or not it is closed. In a closed Polygon the last point
added is automatically considered connected to the very first point; this does not need to be done explicitly. Also, since this concept is very closely tied
to the two-dimensional nature of graphs in this package, point values are given as double and not Object.
Method Summary | |
---|---|
Polygon |
addVertex(double pX,
double pY)
Add a line segment to the Polygon. |
void |
setClosed(boolean pClosed)
Determine whether or not the last point added will be 'connected' to the first point entered. |
Methods inherited from interface cox.jmatt.java.MathTools.graphing.Renderable |
---|
render, setParameter, setType, testCondition |
Method Detail |
---|
Polygon addVertex(double pX, double pY)
pX
- The X-coordinate of the point.pY
- The Y-coordinate of the point.
void setClosed(boolean pClosed)
pClosed
- true to 'close' the Polygon explicitly, false to leave it 'open'.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |