Lines Matching refs:mat
26 def parseTransform(transf,mat=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]):
28 return(mat)
72 matrix=composeTransform(mat,matrix)
78 def formatTransform(mat):
79 return ("matrix(%f,%f,%f,%f,%f,%f)" % (mat[0][0], mat[1][0], mat[0][1], mat[1][1], mat[0][2], mat[1][2]))
81 def invertTransform(mat):
82 det = mat[0][0]*mat[1][1] - mat[0][1]*mat[1][0]
85 a11 = mat[1][1]/det
86 a12 = -mat[0][1]/det
87 a21 = -mat[1][0]/det
88 a22 = mat[0][0]/det
90 a13 = -(a11*mat[0][2] + a12*mat[1][2])
91 a23 = -(a21*mat[0][2] + a22*mat[1][2])
94 return[[0,0,-mat[0][2]],[0,0,-mat[1][2]]]
106 def composeParents(node, mat):
109 mat = composeTransform(parseTransform(trans), mat)
111 mat = composeParents(node.getparent(), mat)
112 return mat
114 def applyTransformToNode(mat,node):
116 newtransf=formatTransform(composeTransform(mat,m))
119 def applyTransformToPoint(mat,pt):
120 x = mat[0][0]*pt[0] + mat[0][1]*pt[1] + mat[0][2]
121 y = mat[1][0]*pt[0] + mat[1][1]*pt[1] + mat[1][2]
125 def applyTransformToPath(mat,path):
129 applyTransformToPoint(mat,pt)
206 def computeBBox(aList,mat=[[1,0,0],[0,1,0]]):
210 m = composeTransform(mat,m)
255 def computePointInNode(pt, node, mat=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]):
257 applyTransformToPoint(invertTransform(composeParents(node, mat)), pt)