# Sep 7

## Loops

Update. Here's an even better lecture about loops (and visualization!) by Lena V. Groeger, "That's the Power of Loops" (at YouTube) or "On Repeat: How to Use Loops to Explain Anything" (at ProPublica or archived in this zip).

## A Consideration of Graphical Nuance

How many ways can you think of to convert a circle to a triangle?
In this Circles to Triangles project, I demonstrate 14 methods that I could think of.
The point of this demonstration is to sensitize you to details of computational craft.

## Creative coding basics and tricks

Let's dig in to some specifics of creative graphics programming.

• The transformation matrix; pushMatrix(), popMatrix(), scale, translate, etc.
• random() vs. Perlin noise(). p5's randomGaussian(). Random seeds.
• The modulus operator; map(), constrain()
• Simple sinusoids; circular motion. Lissajous figures!
• Here's a demonstration of looping noise (Processing) (p5.js)
• Shaping functions (also called easing functions, tweens, and unit generators) can be used to create nonlinear movement:
• Luke DuBois' p5.js-func (JavaScript) is a proper p5.js library which you can include into your project.
• My Pattern_Master (Processing/Java) is just a collection of functions. You'll have to copy/paste code directly to use the functions you want.

If you'd like more information, here are some Coding Train videos that might be helpful for you:

## A Praxinoscope / Zoetrope Activity

Students will use an inexpensive Praxinoscope or a Zoetrope as part of Deliverables #2. We will start our in-class activity:

Code templates:

We looked at: