Exemple #1
0
 def test_estimate_focus_parallel_rays(self):
     p1 = (0, 0, 0)
     p2 = (1, 0, 0)
     r1 = (0, 1, 0)
     r2 = (0, 1, 0)
     rays = Rays(array((p1, p2)), array((r1, r2)),
                 array(((0, 0, 0), (0, 0, 0))))
     a = rays.estimate_focus(1)
     self.assertEqual(a, None)
Exemple #2
0
 def test_estimate_focus_two_rays(self):
     p1 = (0, 0, 0)
     p2 = (1, 0, 0)
     r1 = (1/sqrt(2), 0, 1/sqrt(2))
     r2 = (0, 1, 0)
     rays = Rays(array((p1, p2)), array((r1, r2)),
                 array(((0, 0, 0), (0, 0, 0))))
     a = rays.estimate_focus(1)
     self.assertAllClose(a, (0.75, 0.0, 0.25))