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

Function transformPoint

inprogress/rotatingsphere.py:49–60  ·  view source on GitHub ↗
(point, scalex=None, scaley=None, translatex=None, translatey=None)

Source from the content-addressed store, hash-verified

47
48
49def transformPoint(point, scalex=None, scaley=None, translatex=None, translatey=None):
50 if scalex == None:
51 scalex = DEFAULT_SCALEX
52 if scaley == None:
53 scaley = DEFAULT_SCALEY
54 if translatex == None:
55 translatex = DEFAULT_TRANSLATEX
56 if translatey == None:
57 translatey = DEFAULT_TRANSLATEY
58
59 return (int(point[0] * scalex + translatex),
60 int(point[1] * scaley + translatey))
61
62
63# Directions of each axis:

Callers 1

rotatingsphere.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected