def testRotMatrix(self): params = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] mat = fract4dc.rot_matrix(params) self.assertEqual(mat, ((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0))) vec = fract4dc.eye_vector(params, 1.0) self.assertEqual(vec, (-0.0, -0.0, -1.0, -0.0)) params[6] = math.pi / 2.0 mat = fract4dc.rot_matrix(params) self.assertNearlyEqual(mat, ((0.0, 0.0, 1.0, 0.0), (0.0, 1.0, 0.0, 0.0), (-1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) vec = fract4dc.eye_vector(params, 10.0) self.assertNearlyEqual(vec, (10.0, -0.0, -0.0, -0.0))
def testRotMatrix(self): params = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] mat = fract4dc.rot_matrix(params) self.assertEqual(mat, ((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0))) vec = fract4dc.eye_vector(params,1.0) self.assertEqual(vec, (-0.0, -0.0, -1.0, -0.0)) params[6] = math.pi/2.0 mat = fract4dc.rot_matrix(params) self.assertNearlyEqual(mat, ((0.0, 0.0, 1.0, 0.0), (0.0, 1.0, 0.0, 0.0), (-1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) vec = fract4dc.eye_vector(params,10.0) self.assertNearlyEqual(vec, (10.0, -0.0, -0.0, -0.0))