Пример #1
0
 def test_reorient(self):
     star = Star(1, 0, sph=(0.1204, 1.283))
     #star.spherical_to_cartesian()
     camera = Camera()
     camera.point_at(star)
     orientation = camera.orientation
     new_star = star.reorient(orientation)
     self.assertEquals(tuple(map(round, new_star.cartesian)), (0, 0, 1))
Пример #2
0
 def test_reorient_no_change(self):
     star_orig = Star(1, 0, sph=(0, 0))
     star_orig.spherical_to_cartesian()
     star = Star(1, 0, sph=(0, 0))
     camera = Camera()
     camera.point_at(star)
     orientation = camera.orientation
     new_star = star.reorient(orientation)
     self.assertEquals(star, star_orig)
Пример #3
0
 def test_reorient_raise(self):
     star = Star(1, 0)
     with self.assertRaises(Exception,
                            msg='Star theta,psi coordinates not \
         set.'):
         star.reorient(None)