-
-
Save NicolaM94/f3ca34063ff9a8917290fdb4fd56f083 to your computer and use it in GitHub Desktop.
Draws the time table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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