Package geom implements efficient geometry types.
Encoding and decoding:
Geometry functions:
Example:
func ExampleNewPolygon() {
unitSquare := NewPolygon(XY).MustSetCoords([][]Coord{
{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}},
})
fmt.Printf("unitSquare.Area() == %f", unitSquare.Area())
// Output: unitSquare.Area() == 1.000000
}