Example #1
0
def homog_compose_after_inplace_scale_test():
    # this should be fine
    homog = HomogeneousTransform(np.array([[0, 1, 0],
                                           [1, 0, 0],
                                           [0, 0, 1]]))
    s = Scale([3, 4])
    homog.compose_after_inplace(s)
    assert_allclose(homog.h_matrix, np.array([[0, 4, 0],
                                              [3, 0, 0],
                                              [0, 0, 1]]))
Example #2
0
def homog_compose_after_scale_test():
    homog = HomogeneousTransform(np.array([[0, 1, 0],
                                           [1, 0, 0],
                                           [0, 0, 1]]))
    s = Scale([3, 4])
    res = homog.compose_after(s)
    assert(isinstance(res, HomogeneousTransform))
    assert_allclose(res.h_matrix, np.array([[0, 4, 0],
                                            [3, 0, 0],
                                            [0, 0, 1]]))