예제 #1
0
def test_compose_matrix():
    scale = np.random.random(3) - 0.5
    shear = np.random.random(3) - 0.5
    angles = (np.random.random(3) - 0.5) * (2 * math.pi)
    trans = np.random.random(3) - 0.5
    persp = np.random.random(4) - 0.5
    M0 = t.compose_matrix(scale, shear, angles, trans, persp)
    result = t.decompose_matrix(M0)
    M1 = t.compose_matrix(*result)
    assert_equal(t.is_same_transform(M0, M1), True)
예제 #2
0
def test_compose_matrix():
    scale = np.random.random(3) - 0.5
    shear = np.random.random(3) - 0.5
    angles = (np.random.random(3) - 0.5) * (2*math.pi)
    trans = np.random.random(3) - 0.5
    persp = np.random.random(4) - 0.5
    M0 = t.compose_matrix(scale, shear, angles, trans, persp)
    result = t.decompose_matrix(M0)
    M1 = t.compose_matrix(*result)
    assert_equal(t.is_same_transform(M0, M1), True)
예제 #3
0
def test_compose_matrix():
    scale = np.array([0.2, 0.2, 0.2])  # arbitrary values
    shear = np.array([0.4, 0.4, 0.4])
    angles = np.array([0.6, 0.6, 0.6]) * 2 * np.pi
    trans = np.array([0.8, 0.8, 0.8])
    persp = np.array([0.9, 0.9, 0.9, 0.9])

    M0 = t.compose_matrix(scale, shear, angles, trans, persp)
    result = t.decompose_matrix(M0)
    M1 = t.compose_matrix(*result)
    assert_equal(t.is_same_transform(M0, M1), True)
예제 #4
0
def test_compose_matrix():
    scale = np.array([0.2, 0.2, 0.2])  # arbitrary values
    shear = np.array([0.4, 0.4, 0.4])
    angles = np.array([0.6, 0.6, 0.6]) * 2 * np.pi
    trans = np.array([0.8, 0.8, 0.8])
    persp = np.array([0.9, 0.9, 0.9, 0.9])

    M0 = t.compose_matrix(scale, shear, angles, trans, persp)
    result = t.decompose_matrix(M0)
    M1 = t.compose_matrix(*result)
    assert_equal(t.is_same_transform(M0, M1), True)
예제 #5
0
 def test_decompose_matrix_3(self):
     R0 = t.euler_matrix(1, 2, 3)
     scale, shear, angles, trans, persp = t.decompose_matrix(R0)
     R1 = t.euler_matrix(*angles)
     assert_allclose(R0, R1)
예제 #6
0
 def test_decompose_matrix_2(self):
     S = t.scale_matrix(0.123)
     scale, shear, angles, trans, persp = t.decompose_matrix(S)
     assert_equal(scale[0], 0.123)
예제 #7
0
 def test_decompose_matrix_1(self):
     T0 = t.translation_matrix((1, 2, 3))
     scale, shear, angles, trans, persp = t.decompose_matrix(T0)
     T1 = t.translation_matrix(trans)
     assert_allclose(T0, T1)
예제 #8
0
 def test_decompose_matrix_3(self):
     R0 = t.euler_matrix(1, 2, 3)
     scale, shear, angles, trans, persp = t.decompose_matrix(R0)
     R1 = t.euler_matrix(*angles)
     assert_allclose(R0, R1)
예제 #9
0
 def test_decompose_matrix_2(self):
     S = t.scale_matrix(0.123)
     scale, shear, angles, trans, persp = t.decompose_matrix(S)
     assert_equal(scale[0], 0.123)
예제 #10
0
 def test_decompose_matrix_1(self):
     T0 = t.translation_matrix((1, 2, 3))
     scale, shear, angles, trans, persp = t.decompose_matrix(T0)
     T1 = t.translation_matrix(trans)
     assert_allclose(T0, T1)