Go package to construct simple polygonal shapes.
p, _ := polygon.NewPolygon(
polygon.Point{0, 0},
polygon.Point{0, 3},
polygon.Point{4, 0},
)
fmt.Println(p.Area()) // 6.0
_, err := polygon.NewPolygon(
polygon.Point{0, 0},
polygon.Point{3, 3},
)
fmt.Println(err) // ErrInsufficientPoints
go get github.com/hamonangann/polygon
Fork this repository and open a pull request to improve this project. Your contribution matters a lot!
If you have any inquiries, please raise an issue.