# The Magpi

This Scripting Algebra (SA) activity looks at quadrants, mouse location, and interactive art p5.js.

This activity assumes that the skills from SA1-SA8 were introduced (if-else, logical operators, random(), text(), rect(), variables, loop, pow, for, functions, translate, modulo, etc.). This activity encourages learners to create quadrant art and leverage previous concepts and code.

Save work often and have fun (or just start over if you break it).

• Analyze the code below.
• What symmetries do you see?
• Using the conditional statements for each quadrant, create your own work of art.
• Use shapes and concepts from previous tasks in this project
• Example Code at p5.js.

See the Pen QuadrantArt by Sophia (@fractalkitty) on CodePen.

• This example is similar to the odd code above as an example for an individual’s project.
• Example Code at p5.js.

See the Pen QuadrantArt2 by Sophia (@fractalkitty) on CodePen.

Example Concepts: cartesian coordinates, quadrants, interactive code, variables, coordinate planes, ordered pairs, conditions, loops, random numbers, functions, etc..

# Parametric Play!

Here are some simple animations with parametric equations. What you see below is a function and its inverse. If you click, you will get another semi-random equation.

See the Pen qBZgZvW by Sophia (@fractalkitty) on CodePen.

With commas:

Without commas:

# Foiled by a Foil

I couldn’t resist this GIF for my algebra students. Foiling can be such fun!

# Moiré GIF: by Opal

My daughter started playing with moiré in procreate after I fiddled with it in a previous post. You know we breathe math in our home. She wanted to share:

# Parallel to a Parabola

I received a question today about what curve is parallel to a parabola. I sat for a minute and realized that it wasn’t another parabola. It required parametric equations (at least if you wanted to keep it simple). That of course lead to code:

See the Pen jOqzMJb by Sophia (@fractalkitty) on CodePen.

The parametric equations for the parabola are:

• x = 2at
• y = at2

The parallel curve equations are:

• x = 2at+ct/sqrt(1+t2)
• y = at2 – c/sqrt(1+t2)

High res:

Low res:

# Hex-a-Sierpinski

So I doodled and was pleasantly surprised when Sierpinski-like triangles formed. I am sure that a million people have discovered this before me, but I felt like I found a magic portal.

And that lead to coding (of which is currently a mess, and I will post later).

And one more version: