def test_relationships(self):
     c = Circle(UnitVector3d.X(), Angle.fromDegrees(0.1))
     d = Circle(UnitVector3d(1, 1, 1), Angle(math.pi / 2))
     e = Circle(-UnitVector3d.X())
     self.assertTrue(c.contains(UnitVector3d.X()))
     self.assertTrue(UnitVector3d.X() in c)
     self.assertTrue(d.contains(c))
     self.assertTrue(c.isWithin(d))
     self.assertTrue(c.intersects(d))
     self.assertTrue(c.intersects(UnitVector3d.X()))
     self.assertTrue(e.isDisjointFrom(d))
     self.assertEqual(d.relate(c), CONTAINS)
     self.assertEqual(e.relate(d), DISJOINT)
Beispiel #2
0
 def test_relationships(self):
     e = Ellipse(UnitVector3d.X(), Angle(math.pi / 3), Angle(math.pi / 6),
                 Angle(0))
     self.assertTrue(e.contains(UnitVector3d.X()))
     self.assertTrue(UnitVector3d.X() in e)
     c = Circle(UnitVector3d.X(), Angle(math.pi / 2))
     self.assertEqual(c.relate(e), CONTAINS)
     self.assertEqual(e.relate(c), WITHIN)