In Part 4 of this series on How to Draw a Circle in Scratch the G-poly (center, radius) script was completed. It will take just the addition of a single block to convert the G-poly (center, radius) script to the G-poly (center, radius, arc) script. A comparison of the two scripts is shown below.
Where did the added block come from? In Part 4 we decided to fix the number of sides of the regular polygon at 60. The [turn (right 360/(number of sides)] block then reduced to [turn (right 360/60)] that reduces to [turn right (6)].
We can set up the proportion for 60 sides to 360º as shown below and solve for x, the length of the side that corresponds to 1º.
60:360 = x:1
x = 0.1666…A new [set] block named (arc length)º and a new variable named arc are created. The variable arc is then multiplied by 0.01666… and stored in (arc length)º.
Now the script will draw a full circle if arc is set to 360 or the arc for any angle from 0º to 360º.
For all practical purposes, we have created a geometry compass in Scratch! I made a new background for the G-poly (circle, center, radius, arc) script and renamed the script Geometry Compass. In the following graphic the center was set at (15, -25), the radius to 125, and the arc to 281º.
The Geometry Compass project can be viewed and downloaded at this link.
Click on the Play button to watch a short video of the Geometry Compass in action.
Parts 1–5 of this series of Circle posts (in separate PDF files) can be obtained at no cost by sending an email request to email@example.com.