Esempio n. 1
0
    def test_from_aa(self):
        # Axis should come out of rotation normalized
        angle = 0.8
        axis = [-3, 2, 1]
        axis_norm = array_normalize(axis)

        r = RotationD(angle, axis)
        nose.tools.assert_equal(angle, r.angle())
        numpy.testing.assert_equal(axis_norm, r.axis())
Esempio n. 2
0
    def test_to_axis_angle(self):
        # expected identity: [0,0,1] and 0
        ident_axis = [0, 0, 1]
        ident_angle = 0

        rot_d = RotationD()
        rot_f = RotationF()

        numpy.testing.assert_equal(rot_d.axis(), ident_axis)
        nose.tools.assert_equal(rot_d.angle(), ident_angle)

        numpy.testing.assert_equal(rot_f.axis(), ident_axis)
        nose.tools.assert_equal(rot_f.angle(), ident_angle)