############################################################## import matplotlib.pyplot as plt import numpy as np import math def InitDraw2D(xmin,xmax,ymin,ymax): plt.axis('equal') plt.axis([xmin, xmax, ymin, ymax]) plt.grid() def Draw2D(*O): for M in O: soa =np.array( M) x,y = zip(*soa) plt.plot(x,y) plt.draw() def Show2D(): plt.show() ############################################################## def ROB10(): M1=[[3,2],[5,2],[5,4],[6,4],[4,6],[2,4],[3,4],[3,2]] TM = MatrixCreateH(MatrixIdentity(2),[[5,4]],D=2) M2=[] for x,y in M1: M2.append( MatrixTranspose(MatrixMult(TM,MatrixTranspose([[x,y,1]])))[0][0:2]) InitDraw2D(0,12,0,12) Draw2D(M1,M2) Show2D()