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

Function transformPoint

src/gamesbyexample/fireflies.py:171–175  ·  view source on GitHub ↗

Resizes this 2D point by a scale of scalex and scaley, then moves the point by translatex and translatey.

(point)

Source from the content-addressed store, hash-verified

169
170
171def transformPoint(point):
172 """Resizes this 2D point by a scale of scalex and scaley, then moves
173 the point by translatex and translatey."""
174 return (int(point[X] * SCALEX + TRANSLATEX),
175 int(point[Y] * SCALEY + TRANSLATEY))
176
177
178def displayFireflies(lightPoints, darkPoints):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected