
Dr Logo has no primitive that draws a circle. It does not need one.
Go forward a little, turn a little, and do it enough times, and you are back where you started having drawn something no one would call a polygon.
repeat 36 [fd 5 rt 10]
Thirty-six turns of ten degrees is one full revolution. Each side is five steps long, so the turtle walks 180 steps in all - and a loop 180 round has a diameter of about 57, which is what you get.

Two numbers control it and they do different jobs:
repeat 360 [fd 1 rt 1]?Because you will be waiting. Dr Logo draws about eleven turtle steps a second, so a 360-sided circle takes the best part of half a minute, and on a 256-pixel screen it looks exactly like the 36-sided one that took three seconds.
Ten degrees a step is smooth enough for anything the Einstein can display. Save the fine steps for when you can see the difference.
to arc :size :steps
repeat :steps [fd :size rt 10]
end
arc 5 36 is the whole circle. arc 5 9 is a quarter of it - nine steps of ten
degrees is ninety. arc 5 18 is a half.
Two quarter arcs with a right angle between them make a petal:
to petal :size
arc :size 9
rt 90
arc :size 9
rt 90
end
Walk it through. Curve round ninety degrees, turn sharply, curve back ninety, turn sharply again - and you are where you began, facing how you began. That is the same closing trick as S22's bar, and it buys the same thing:
repeat 6 [petal 5 rt 60]
to arc :size :steps
repeat :steps [fd :size rt 10]
end
to petal :size
arc :size 9
rt 90
arc :size 9
rt 90
end
cs
ht
repeat 6 [petal 5 rt 60]
Starting from
A fresh boot, at the ? prompt.
What you should see

It takes about ten seconds. Six petals, because six sixties are 360.
A circle comes from turning. A wave comes from working out where each point
should be and going there - and for that Dr Logo has sin.
?show sin 30
0.5
?show sin 90
1
Degrees, not radians, and the answer is a decimal between -1 and 1. Multiply it by how tall you want the wave, and you have a height for every angle:
to wave :deg
if :deg > 720 [stop]
make "x :deg / 3
make "y sin :deg
setpos se :x - 120 :y * 40
wave :deg + 10
end
se builds the [x y] pair that setpos wants out of the two numbers. Run it
from the left-hand edge with the pen already down at the first point:
cs ht pu setpos [-120 0] pd
wave 0

Two full cycles, because 720 degrees is twice round.
arc 15 36. The circle is bigger than the screen. What happens at the edge,
and does Dr Logo tell you?rt 60 to rt 45 in the flower line and repeat 6 to repeat 8.
Then try eight petals with rt 60 still in place and see what a mismatch
looks like.setscrunch 2, then draw the circle again. The width is untouched and the
height doubles - setscrunch stretches the picture vertically, and 1 is
what you start with.sin to cos in wave. The curve starts at the top instead of the
middle - and you get an unwanted vertical line at the left. Work out where it
came from.| Symptom | Cause |
|---|---|
| A polygon, not a circle | The step is too long for the turn. Smaller fd, or more steps. |
| It never closes | The steps and the turn do not multiply to 360. |
| It is taking forever | Too many steps. repeat 36 [fd 5 rt 10] looks the same as repeat 360 [fd 1 rt 1] and is ten times faster. |
| Part of the circle is missing | It is bigger than the screen. Lines outside are not drawn and you are not told. |
| The circle is an oval | setscrunch is not 1. show sf reports it as the last of the five things it gives you. |
| A stray line at the start of a plotted curve | The pen was down somewhere else when the first setpos ran. |
A circle is repeat 36 [fd n rt 10] - thirty-six straight lines, with the step
setting the size and the numbers multiplying to 360. Stop early and you have an
arc; make a shape that closes and you can repeat it into a flower. For a curve
that is not made of turning, sin gives a height for an angle in degrees and
setpos puts the turtle there.
S24, patterns - what happens when you repeat something that very nearly closes.