-
-
Save NicolaM94/c7031addaa3371dfc673ce988220a495 to your computer and use it in GitHub Desktop.
Draws all the points on the circle
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
# Draws all the points on a circle with an origin and a given radius | |
coordinates = {} | |
def drawCircumferencePoints (turtle :turtle.Turtle, radius :int,coordinates :dict, numberOfPoints :int=1000, penSize :int=1,penColor :str="black",writeLabel :bool=False): | |
turtle.pensize(penSize) | |
turtle.pencolor(penColor) | |
def singlePointDraw (angle): | |
turtle.up() | |
turtle.goto( | |
radius*math.sin(angle), | |
radius*math.cos(angle) | |
) | |
turtle.down() | |
turtle.dot() | |
angle = calculateAngle(numberOfPoints) | |
for i in range(numberOfPoints): | |
singlePointDraw(i*angle) | |
coordinates[i] = turtle.pos(),i*angle | |
if writeLabel: | |
turtle.write(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment