MCPcopy Create free account
hub / github.com/ActiveState/code / alignWith

Method alignWith

recipes/Python/577405_Penrose_Tiler/recipe-577405.py:123–134  ·  view source on GitHub ↗
(self, nodeobj, nCnr2)

Source from the content-addressed store, hash-verified

121 self.redArc()
122 self.blueArc()
123 def alignWith(self, nodeobj, nCnr2):
124 p1 = nodeobj.p1
125 p2 = nodeobj.p2
126 dx1 = p2[0] - p1[0]
127 dy1 = p2[1] - p1[1]
128 nTheta2 = atan2(dy1,dx1)
129 q1 = self.vertices[nCnr2]
130 q2 = self.vertices[(nCnr2 - 1)%4]
131 dx2 = q2[0] - q1[0]
132 dy2 = q2[1] - q1[1]
133 nTheta1 = atan2(dy2,dx2)
134 self.drawOutline(p1[0], p1[1], nTheta2 - nTheta1,nCnr2)
135
136class kite(shape):
137 def GetPoints(self, cColour = 'brown'):

Callers 1

addToBorderFunction · 0.80

Calls 2

drawOutlineMethod · 0.95
atan2Function · 0.85

Tested by

no test coverage detected