def testInDent(self): position = [1.0, 1.0] polygon = [[0.0, 0.0], [2.0, 1.0], [0.0, 2.0], [4.0, 2.0], [3.0, 0.0], [0.0, 0.0]] self.assertFalse(skurt_challenge.insideRange(position, polygon))
def testWeirdShape(self): position = [1.5, 0.5] polygon = [[0.0, 0.0], [0.0, 2.0], [2.0, 2.0], [2.0, 1.0], [3.0, 1.0], [3.0, -1.0], [1.0, -1.0], [1.0, 0.0], [1.0, 1.0], [2.0, 1.0], [2.0, 0.0], [1.0, 0.0], [0.0, 0.0]] self.assertFalse(skurt_challenge.insideRange(position, polygon))
def testAtVertex(self): position = [2.0, 2.0] polygon = [[0.0, 0.0], [2.0, 2.0], [4.0, 0.0], [0.0, 0.0]] self.assertTrue(skurt_challenge.insideRange(position, polygon))
def testDiagonal(self): position = [1.0, 1.0] polygon = [[0.0, 0.0], [2.0, 2.0], [4.0, 0.0], [0.0, 0.0]] self.assertTrue(skurt_challenge.insideRange(position, polygon))