Class Polygon

A polygon is an object defined by its vertices in 2 space T is the type of the polygon and sides is how many sides the polygon has

class Polygon(T, uint numSides) ;

Constructors

NameDescription
this Creates an empty polygon
this Creates a polygon using a list of vertices as vertices

Fields

NameTypeDescription
vertices Vector!(T,2)[numSides]The vertices of the polygon

Properties

NameTypeDescription
sides[get] Segment!(T,2)[numSides]Gets the sides of a polygon

Methods

NameDescription
contains Returns whether or not a given point is inside the polygon This algorithm uses scanlining (see Renderer.fillPolygon) Conceptually, it draws a ray to the left from the given point; if the ray intersects the polygon an odd number of times the point is within the polygon
opCast Casts the polygon to a polygon of another type

TODO

upgrade to dimension-ambiguous model class in math