Skip to content

hamonangann/polygon

Repository files navigation

polygon

Go package to construct simple polygonal shapes.

Example

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

Installation

go get github.com/hamonangann/polygon

Contribution

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.

About

Go library for constructing polygonal shapes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages