/go-geom

Go library for handling geometries

Primary LanguageGoBSD 2-Clause "Simplified" LicenseBSD-2-Clause

go-geom

Build Status GoDoc

Package geom implements efficient geometry types.

Encoding and decoding:

Geometry functions:

  • XY 2D geometry functions
  • XYZ 3D 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
}

License