Can some explain why this wont draw a circle? It is drawing roughly 3/4?
- by Brandon Shockley
If we want to use n small lines to outline our circle then we can just divide both the circumference and 360 degrees by n (i.e , (2*pi*r)/n and 360/n).
Did I not do that?
import turtle, math
window = turtle.Screen()
window.bgcolor('blue')
body = turtle.Turtle()
body.pencolor('black')
body.fillcolor('white')
body.speed(10)
body.width(3)
body.hideturtle()
body.up()
body.goto(0, 200)
lines = 40
toprad = 40
top_circum = 2 * math.pi * toprad
sol = top_circum / lines
circle = 360 / lines
for stops in range(lines):
body.pendown()
body.left(sol)
body.forward(circle)
window.exitonclick()