def test_self_tangent(self): "test if tangent is part of circle" circle1 = Circle() circle2 = Circle(Vec2D(0, 2), 1) tan = Tangent(Vec2D(0, 1), circle1, None, Vec2D(0, 2), circle2, None) self.assertFalse(circle1.intersects_tangent(tan)) self.assertFalse(circle2.intersects_tangent(tan))
def test_self_tangent(self): "test if tangent is part of circle" circle1 = Circle() circle2 = Circle(Vec2D(0, 2), 1) tan = Tangent(Vec2D(0, 1), circle1, None, Vec2D(0, 2), circle2, None) self.assertFalse(circle1.intersects_tangent(tan)) self.assertFalse(circle2.intersects_tangent(tan))
def test_contains_tangent(self): "test start and end inside circle" circle = Circle() tangent = Tangent(Vec2D(0, -0.5), None, None, Vec2D(0, 0.5), None, None) self.assertFalse(circle.intersects_tangent(tangent))
def test_nonintersecting_tangent(self): "test intersection with nonintersecting tangent" circle = Circle() tan = Tangent(Vec2D(10, 10), None, None, Vec2D(11, 11), None, None) self.assertFalse(circle.intersects_tangent(tan))
def test_touching_tangent(self): "test start and end inside circle" circle = Circle() tangent = Tangent(Vec2D(0, 1), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))
def test_contains_tangent(self): "test start and end inside circle" circle = Circle() tangent = Tangent(Vec2D(0, -0.5), None, None, Vec2D(0, 0.5), None, None) self.assertFalse(circle.intersects_tangent(tangent))
def test_fullintersection_tangent(self): "test 2 intersection points" circle = Circle() tangent = Tangent(Vec2D(0, -2), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))
def test_intersecting_tangent(self): "test single intersection point" circle = Circle() tangent = Tangent(Vec2D(), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))
def test_nonintersecting_tangent(self): "test intersection with nonintersecting tangent" circle = Circle() tan = Tangent(Vec2D(10, 10), None, None, Vec2D(11, 11), None, None) self.assertFalse(circle.intersects_tangent(tan))
def test_touching_tangent(self): "test start and end inside circle" circle = Circle() tangent = Tangent(Vec2D(0, 1), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))
def test_fullintersection_tangent(self): "test 2 intersection points" circle = Circle() tangent = Tangent(Vec2D(0, -2), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))
def test_intersecting_tangent(self): "test single intersection point" circle = Circle() tangent = Tangent(Vec2D(), None, None, Vec2D(0, 2), None, None) self.assertTrue(circle.intersects_tangent(tangent))