#! /usr/bin/python3 # =================================================================== # Test transformation order # =================================================================== # # translate,rotate # | # (-100,100) * | * (100,100) # (rotate) | (translate) # | # | # --------------+-------------- # | # | # # ------------------------------------------------------------------- # # rotate,translate # | # | * (100,100) # | (translate) # | # | (0,0) (rotate) # --------------+-------------- # | # | # # =================================================================== import transformation_matrix as tm print() print('----------------------------------') print('Coords : x=0, y=0') print('Translate: x=100, y=100') print('Rotate : 90 degrees') print('----------------------------------') c = [0.0, 0.0, 1.0] tm1 = tm.get_translation_matrix_2d(100.0, 100.0) tm2 = tm.get_z_rotation_matrix_2d(90.0) tm3 = tm2 @ tm1 x = tm3 @ c print() print('translate, rotate') print(x) tm4 = tm1 @ tm2 x = tm4 @ c print() print('rotate, translate') print(x)