Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 732 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 732 Bytes

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.