Turning and Growing 🌀¶
Spin shapes round and make them bigger or smaller
Turning with angle ↻¶
Every shape has an angle: how far it is turned. Angles are measured in degrees, clockwise, like the hands of a clock.
angle |
What it does |
|---|---|
0 |
not turned (this is what every shape starts with) |
90 |
a quarter turn |
180 |
a half turn: upside down |
360 |
all the way round, back where it started |
A square turned 45 becomes a diamond:
Canvas paper having width 400, length 200
draw square at 60, 60 having size 80, fill "skyblue"
draw square at 240, 60 having size 80, fill "gold", angle 45
A shape turns around its center, so the diamond stays in the same place as the square it came from.
Growing with scale 🔍¶
Every shape also has a scale: how big it is compared with how you drew it.
scale |
What it does |
|---|---|
1 |
the size you drew it (this is what every shape starts with) |
2 |
twice as big |
0.5 |
half as big |
Canvas paper having width 400, length 200
draw circle at 70, 100 having radius 20, fill "tomato"
draw circle at 170, 100 having radius 20, fill "tomato", scale 2
draw circle at 290, 100 having radius 20, fill "tomato", scale 3
Everything grows: the outline gets thicker and words get bigger too, just like zooming in. A shape grows from its center, so it gets bigger in every direction.
Turning in a Loop 🔁¶
angle is a number, so it can use count. Each bar here is turned a bit more than the one before:
Canvas paper having width 400, length 300
draw circle sun at 200, 150 having radius 40, fill "gold"
repeat 6 times {
draw rectangle at 195, 70 having width 10, length 160, fill "orange", angle count * 30
}
draw circle at 200, 150 having radius 30, fill "yellow"
Turning a Shape with Parts 🌬️¶
When a shape has parts inside it, the parts turn with it, as one piece. Here are two long blades that cross at the hub of a windmill:
Canvas paper having width 400, length 300
draw circle hub at 200, 150 having radius 12, fill "brown", angle 20 {
rectangle at -6, -90 having width 12, length 180, fill "white"
rectangle at -6, -90 having width 12, length 180, fill "white", angle 90
circle at 0, 0 having radius 8, fill "brown"
}
Change angle 20 to another number and the whole windmill turns. A shape with parts turns around the middle of all its parts together.
It works for shapes you make with recipes, too:
Canvas paper having width 400, length 200
shape face having size 80 {
circle head at 0, 0 having radius size / 2, fill "gold"
circle at -15, -10 having radius 6, fill "black"
circle at 15, -10 having radius 6, fill "black"
arc from 20, 12 to -20, 12 having radius 25, thickness 3
}
draw face at 80, 100
draw face at 200, 100 having angle 30
draw face at 320, 100 having angle 180, scale 0.7
Changing It Later ✏️¶
angle and scale can be changed like any other property:
Canvas paper having width 300, length 200
square box at 110, 60 having size 80, fill "plum"
box.angle = 45
box.scale = 0.5
draw box
And you can read them from a named shape, like box.angle.
Where Did the Corner Go? 📍¶
After a shape turns, its points move with it. box.topLeft is the corner that started at the top left, wherever it is now:
Canvas paper having width 300, length 200
draw square box at 110, 60 having size 80, fill "plum", angle 30
draw circle at box.topLeft having radius 6, fill "red"
draw circle at box.center having radius 6, fill "black"
The center doesn't move, because that's what the shape turns around.
Challenge Time! 🏆¶
- 🌟 Challenge 1: Draw a flower with eight petals, using a loop that turns each oval petal a bit more.
- 🌟 Challenge 2: Make a clock face with twelve marks round the edge.
- 🌟 Challenge 3: Draw the same recipe three times: small, medium and big, using
scale. - 🌟 Challenge 4: Put a dot on every corner of a turned square, using
topLeft,topRight,bottomLeftandbottomRight.
What's Next? 🚀¶
You can now turn shapes with angle and grow them with scale, on their own or with all their parts.
Next, you'll make shapes move, turn and grow while you watch.