UConn Computational Geometry

View My GitHub Profile

Compugeom.GitHub.io by compugeom

CG_Polygon

Description

A drawable polygon.

Constructor

CG_Polygon((optional) [CG_Vertex] vertices)

Attributes

[CG_Vertex] VertexList A list of edges contained in this polygon.
[CG_Edge] EdgeList A list of edges contained in this polygon.

Functions

CG_Vertex v(Number i) Returns vertex with index i % VertexList.length.
CG_Edge e(Number i) Returns edge with index i % EdgeList.length.
null newVertex(CG_Vertex v) Adds vertex v to VertexList and rebuilds the edge list.
CG_Edge newEdge(CG_Vertex u, CG_Vertex v) Adds a new edge with endpoints u and v.
null buildHull() Constructs the edge list from vertices in VertexList
[CG_Vertex] fetchVertices() Returns the list of vertices in EdgeList.
Boolean orient(Number i, Number j, CG_Vertex w) Returns w.ccw(this.v(i), this.v(j)).