19 lines
284 B
Go
19 lines
284 B
Go
package main
|
|
|
|
import (
|
|
"github.com/reklesio/gg/src/gx"
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
p := gx.Polygon{
|
|
gx.Vertex{0, 0},
|
|
gx.Vertex{0, 50},
|
|
gx.Vertex{25, 50},
|
|
gx.Vertex{30, 40},
|
|
gx.Vertex{40, 30},
|
|
}
|
|
|
|
fmt.Println("barycenter:", p.Barycenter())
|
|
fmt.Println("edges:", p.Edges())
|
|
}
|