1 of 16

.ca

Nature, Spirals, Math, & Art

with

lynxcoding.club

Geometric Fun!

lynxcoding.club

.ca

V2.2

2 of 16

@CanCodeToLearn

#CanCodeToLearn

3 of 16

Lynx is a text-based, cloud-based programming environment that is the natural next step for kids that are ready to move on from using blocks to code but might not be quite ready to use more complex programming languages like Python or JavaScript.

Think of it as a stepping stone! Projects made with Lynx are easily shareable.

For lots of LYNX learning, go to CanCodeToLearn.ca

4 of 16

Nature, Spirals, Math, & Art

peter@codetolearn.ca

Go to lynxcoding.club and get a free account if you’re Canadian!

Go to ALL Projects.

Open the Math Folder

Click on Public: Nature, Spirals, Math and Art

If you are new to LYNX, we suggest you play with the Art of the Lynx

BEFORE

You try this project.

NOTE:

These are DRAFT!

5 of 16

Nature, Spirals, Math, & Art

Navigate to the "Simple Spirals" Page

AND

To the "Simple Spirals" Procedure Pane

(if you are not already there!)

6 of 16

Nature, Spirals, Math, & Art

Single Variable (square :size)

to square :size

repeat 4 [fd :size rt 90]

end

Let’s change the pensize to 3

Setpensize 3

Simple Spirals

to spiral :step :angle

fd :step

rt :angle

spiral :step + 5 :angle

end

try:

spiral 0 50

WOWEE! What happened?!

It doesn’t stop!!! And it’s too fast!!

Slow it Down

Let’s see it happening better

Put in a wait command

Add in wait 3

fd :step

rt :angle

wait 3

spiral :step + 5 :angle

end

Aha! Keeps going! Why?

7 of 16

Nature, Spirals, Math, & Art

Add a Condition!

Add in:

if :step = 100 [stop]

to spiral :step :angle

if :step = 100 [stop]

fd :step

rt :angle

wait 3

spiral :step + 5 :angle

end

Watch This!

Now type

spiral 1 50

What happened!?

WHY?

We have to change it from = to >:

to spiral :step :angle

if :step > 100 [stop]

fd :step

rt :angle

wait 3

spiral :step + 5 :angle

end

8 of 16

Nature, Spirals, Math, & Art

MAKE CHANGES

Now what is available to change?

Step, angle at the execution!

Step, angle in the procedure!

EXECUTION

CHANGE THE STEP

Now, let’s just change the fd and see the differences

spiral 10 50

cg

spiral 20 50

cg

spiral 30 50

It’s hard to see the difference

So let’s send the turtle HOME each time

cg

spiral 1 50

pu

home

pd

spiral 10 50

pu

home

pd

spiral 30 50

hmmmm still hard to see the difference

let’s change the colours each time

spiral 1 50

pu

home

pd

setc 'red

spiral 10 50

pu

home

pd

setc 'blue

spiral 30 50

So we can see that it is that FIRST step that is the biggest. After that, things look fairly similar. Why?

9 of 16

Nature, Spirals, Math, & Art

CHANGE THE ANGLE

Spiral 1 50

pu

home

pd

setc 'red

spiral 1 80

pu

home

pd

setc 'blue

spiral 1 120

10 of 16

Nature, Spirals, Math, & Art

PROCEDURE

NOW CHANGE THE PROCEDURE

CHANGE THE STEP

Type spiral 1 30

Ok

Change the STEP to 1

to spiral :step :angle

if :step > 100 [stop]

fd :step

rt :angle

wait 3

spiral :step + 1 :angle

end

Type spiral 1 30

Change the STEP to .5

to spiral :step :angle

if :step > 100 [stop]

fd :step

rt :angle

wait 3

spiral :step + .5 :angle

end

Change the STEP to .2

What if we use NEGATIVE numbers?

e.g., :step - 5

11 of 16

Nature, Spirals, Math, & Art

CHANGE THE ANGLE

to spiral :step :angle

if :step > 100 [stop]

fd :step

rt :angle

wait 3

spiral :step :angle + 10

end

Type

spiral 1 30

Well, can’t see much cuz it’s such a small step that doesn’t increase!

Type

spiral 10 30

spiral 30 30

spiral 10 5

CHANGE ANGLE TO +30

to spiral :step :angle

if :step > 100 [stop]

fd :step

rt :angle

wait 3

spiral :step :angle + 30

end

Type

spiral 40 5

AND OF COURSE YOU COULD CHANGE BOTH!

12 of 16

Nature, Spirals, Math, & Art

Navigate to the "Simple Beads" Page

AND

To the "Simple Beads" Procedure Pane

This page and procedure pane just show you how the beads are made.

13 of 16

Nature, Spirals, Math, & Art

Navigate to the "Spirals with Beads" Page

AND

To the "Spirals with Beads" Procedure Pane

14 of 16

Nature, Spirals, Math, & Art

SPIRALS WITH BEADS

to spiralA :step :angle

if :step > 80 [stop]

fd :step

rt :angle

stamp

wait 2

spiralA :step + 2 :angle

end

Type spiralA 2 20

But then put pd in there

tighten the spiral? How?

tighter angles

Type spiralA 2 30

Type spiralA 2 40

Type spiralA 2 300

Type spiralA 2 100

Change if :step >80 to >200

Type spiralA 10 75

Type spiralA 10 60

Type spiralA 10 45

Type spiralA 10 ????

15 of 16

Nature, Spirals, Math, & Art

Now change the angle!!!

to spiralB :step :angle

if :angle > 100 [stop]

stamp

fd :step

rt :angle

wait 1

spiralB :step :angle + 1

end

type spiralB 20 1

SPIRALC

to spiralC :step :angle

if :angle > 200 [stop]

stamp

fd :step

rt :angle

wait 1

spiralC :step :angle - 1

end

spiralC 50 90

16 of 16

Nature, Spirals, Math, & Art

Navigate to the "Dancing Spirals" Page

AND

To the "Dancing Spirals" Procedure Pane

PLAY!!!!