MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / transformPoint

Function transformPoint

inprogress/rotatingcubebext.py:118–132  ·  view source on GitHub ↗
(point1, point2, scalex=None, scaley=None, translatex=None, translatey=None)

Source from the content-addressed store, hash-verified

116
117
118def transformPoint(point1, point2, scalex=None, scaley=None, translatex=None, translatey=None):
119 if scalex == None:
120 scalex = DEFAULT_SCALEX
121 if scaley == None:
122 scaley = DEFAULT_SCALEY
123 if translatex == None:
124 translatex = DEFAULT_TRANSLATEX
125 if translatey == None:
126 translatey = DEFAULT_TRANSLATEY
127
128
129 return (int(point1[0] * scalex + translatex),
130 int(point1[1] * scaley + translatey),
131 int(point2[0] * scalex + translatex),
132 int(point2[1] * scaley + translatey))
133
134
135bext.fg('random')

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected