Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Polygon ¶
Polygon defines a list of closed points that define a polygon.
func New ¶
New creates a new polygon from a whitespace separated list of comma separated coordinates e.g. `1,2 3,4 5,6`. A polygon contains at least 3 points. If 2 points are given it is assumed, that the region is a rectangle with an upper and lower point. In this case a polygon with all the 4 points is returned.
func (Polygon) BoundingRectangle ¶
BoundingRectangle returns the minimal rectangle containing all of the polygon's points.
func (Polygon) Inside ¶
Inside returns true if the given point lies within the polygon. Implementation: https://stackoverflow.com/questions/217578/how-can-i-determine-whether-a-2d-point-is-within-a-polygon