comment
This commit is contained in:
parent
d3527d192f
commit
e11f199d53
1 changed files with 3 additions and 1 deletions
|
@ -2,7 +2,9 @@ package geom
|
||||||
|
|
||||||
import "image"
|
import "image"
|
||||||
|
|
||||||
// PolygonContains reports if a polygon contains a point
|
// PolygonContains reports if a polygon contains a point. The polygon must be in
|
||||||
|
// clockwise order if +Y is pointing upwards, or anticlockwise if +Y is pointing
|
||||||
|
// downwards.
|
||||||
func PolygonContains(polygon []image.Point, p image.Point) bool {
|
func PolygonContains(polygon []image.Point, p image.Point) bool {
|
||||||
for i, q := range polygon {
|
for i, q := range polygon {
|
||||||
r := polygon[(i+1)%len(polygon)]
|
r := polygon[(i+1)%len(polygon)]
|
||||||
|
|
Loading…
Reference in a new issue