pip-go icon indicating copy to clipboard operation
pip-go copied to clipboard

{0.1, 0.1} not in [{0, 0}, {0, 1}, {1, 1}, {1, 0}] ?

Open dspo opened this issue 6 years ago • 0 comments

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

dspo avatar Jun 22 '19 11:06 dspo