pip-go
pip-go copied to clipboard
{0.1, 0.1} not in [{0, 0}, {0, 1}, {1, 1}, {1, 0}] ?
func TestPip4(t *testing.T) {
rectangle := pip.Polygon{
Points: []pip.Point{
pip.Point{X: 0.0, Y: 0.0},
pip.Point{X: 0.0, Y: 1.0},
pip.Point{X: 1.0, Y: 1.0},
pip.Point{X: 1.0, Y: 0.0},
},
}
pt2 := pip.Point{X: 0.1, Y: 0.1} // Should be true
if pip.PointInPolygon(pt2, rectangle) != true {
t.Error("wrong result !")
}
}
=== RUN TestPip4
--- FAIL: TestPip4 (0.00s)
pip_test.go:111: wrong result !
FAIL