Skip to content

Instantly share code, notes, and snippets.

@NicolaM94
Last active June 7, 2023 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NicolaM94/f3ca34063ff9a8917290fdb4fd56f083 to your computer and use it in GitHub Desktop.
Save NicolaM94/f3ca34063ff9a8917290fdb4fd56f083 to your computer and use it in GitHub Desktop.
Draws the time table
def drawTable(turtle :turtle.Turtle,timesTable :float, coordinates :dict, radius :int, numberOfPoints :int,penSize :int=1,penColor :str="black"):
turtle.pensize(penSize)
turtle.pencolor(penColor)
angle = calculateAngle(numberOfPoints)
for n in range(numberOfPoints):
turtle.up()
startingPoint = (
coordinates[n][0][0],
coordinates[n][0][1]
)
result = (n * timesTable)%len(coordinates)
endPoint = (
radius*math.sin(result*angle),
radius*math.cos(result*angle)
)
turtle.goto(startingPoint[0],startingPoint[1])
turtle.down()
turtle.goto(endPoint[0],endPoint[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment