I am trying to write a program to print a circle of given diameter in Berkeley logo. I get the input diameter from the user of the program and draw a circle accordingly. But I do not know of any method to display a circle given the diameter. All along I have been using,
repeat 36 [fd 10 rt 10]
to draw a circle. But it is not what I want. I tried using formulas for diameter, but it is not working. Can anybody please help?
You have to find the perimeter first, then divide it by the total number of rotations, then set that as the value of forward in your loop.
E.g.
you can have all of them in a single statement as
where d is the accepted value of the diameter