Example #1
0
    def test_no_rotation_matrix(self):
        """Check if no rotation is correctly returned"""

        no_rotation = array(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
        testing.assert_equal(axes.rotation_matrix(0, 'x'), no_rotation)
        testing.assert_equal(axes.rotation_matrix(0, 'y'), no_rotation)
        testing.assert_equal(axes.rotation_matrix(0, 'z'), no_rotation)
Example #2
0
    def test_no_rotation_matrix(self):
        """Check if no rotation is correctly returned"""

        no_rotation = matrix(((1, 0, 0), (0, 1, 0), (0, 0, 1)))
        testing.assert_equal(axes.rotation_matrix(0, 'x'), no_rotation)
        testing.assert_equal(axes.rotation_matrix(0, 'y'), no_rotation)
        testing.assert_equal(axes.rotation_matrix(0, 'z'), no_rotation)
Example #3
0
    def test_rotation_matrix(self):
        """Rotate by 90 degrees to swap the other two axes"""

        testing.assert_almost_equal(axes.rotation_matrix(pi / 2., 'x'),
                                    array(((1, 0, 0), (0, 0, 1), (0, -1, 0))))
        testing.assert_almost_equal(axes.rotation_matrix(pi / 2., 'y'),
                                    array(((0, 0, -1), (0, 1, 0), (1, 0, 0))))
        testing.assert_almost_equal(axes.rotation_matrix(pi / 2, 'z'),
                                    array(((0, 1, 0), (-1, 0, 0), (0, 0, 1))))
Example #4
0
    def test_rotation_matrix(self):
        """Rotate by 90 degrees to swap the other two axes"""

        testing.assert_almost_equal(axes.rotation_matrix(pi / 2., 'x'),
                                    matrix(((1, 0, 0), (0, 0, 1), (0, -1, 0))))
        testing.assert_almost_equal(axes.rotation_matrix(pi / 2., 'y'),
                                    matrix(((0, 0, -1), (0, 1, 0), (1, 0, 0))))
        testing.assert_almost_equal(axes.rotation_matrix(pi / 2, 'z'),
                                    matrix(((0, 1, 0), (-1, 0, 0), (0, 0, 1))))