Example #1
0
 def test_ray_line_intersection(self):
     p = GeometryTools.rayLineIntersection((0,0) , (1,0) , (5,-1),(5,1))
     self.assertEqual( p , (5,0))
     
     self.assertIsNone( GeometryTools.rayLineIntersection((0,0) , (-1,0) , (5,-1),(5,1)) )
     self.assertIsNone( GeometryTools.rayLineIntersection((0,0) , (0,1) , (5,-1),(5,1)) )
     self.assertIsNone( GeometryTools.rayLineIntersection((0,0) , (0,-1) , (5,-1),(5,1)) )
     
     p = GeometryTools.rayLineIntersection((0,0) , (1,1) , (5,-6),(5,6))
     self.assertEqual( p , (5,5))
Example #2
0
    def test_ray_line_intersection(self):
        p = GeometryTools.rayLineIntersection((0, 0), (1, 0), (5, -1), (5, 1))
        self.assertEqual(p, (5, 0))

        self.assertIsNone(
            GeometryTools.rayLineIntersection((0, 0), (-1, 0), (5, -1),
                                              (5, 1)))
        self.assertIsNone(
            GeometryTools.rayLineIntersection((0, 0), (0, 1), (5, -1), (5, 1)))
        self.assertIsNone(
            GeometryTools.rayLineIntersection((0, 0), (0, -1), (5, -1),
                                              (5, 1)))

        p = GeometryTools.rayLineIntersection((0, 0), (1, 1), (5, -6), (5, 6))
        self.assertEqual(p, (5, 5))