# teaching machines

## Bathroom Angles

Our bathroom gave me a math problem, and I failed. Herein I document my failure and visualize the answer I should have provided. When we bought our home, the bathroom had carpet but no baseboard. This combination makes painting the walls difficult. As we are preparing to paint, I decided to install some baseboard. Measuring, […]

## Cutting Corners

I learned recently of Chaikin’s Algorithm, a method for rounding off the corners of a polygon. The algorithm works like this: Find the midpoints of each line segment in the polygon’s perimeter. Connect each consecutive pair of midpoints using a quadratic Bezier curve. The midpoints are the curve’s endpoints. The vertex between them is the […]

## Circle Dance

At one time, people believed that the Earth was the center of the universe, and that the planets and the sun orbited around it. Copernicus came along and challenged this idea, suggesting that the sun was the center. These are the only two sides of the debate that we ever hear about. Heliocentrism vs. geocentrism […]

## Background Check

There’s somebody on Twitter named Dave who makes animations that break your mind. I fell in love with a simple rotating one a couple of weeks ago and recreated it in Twoville: Several others have recreated it too, but they appear to have fallen for the same trap that I initially fell for. They enumerated […]

## Progress in Twoville

Today was a non-teaching day, so I made some “progress” in Twoville: You could summarize my professional career as one long effort to get to the point where I can express non-trivial ideas about shapes and animations in around 30 lines of code that doesn’t need to be compiled.

## Power Set of Venn Diagrams

In our introductory programming class, I try to reframe abstract logic into concrete spatial thinking. One way I do this is through the game Trux Falsy. Another way is through Venn diagrams. I want students to see how the AND operator creates an intersection, how the OR operator creates a union, and how DeMorgan’s Law […]

## New Geometry

What do you call a portion of the shaded area between two arcs? A sharc. The figure above was created in Twoville, a little language for drawing vector art. Here’s the complete program:

## Interpolants in Twoville

Shapes in Twoville are animated across time by interpolating their properties between keyframes. Time is a first-class concept in the language, with assignment statements storing values across a timeline rather than in a static memory cell. Here’s a rectangle that oscillates left and right using this keyframe-sensitive assignment syntax: The animation above uses linear interpolation. […]

## Starring Matariki

During our last week in New Zealand, we attended the Matariki Festival at my sons’ school. Matariki is the Māori name for one of the stars that becomes visible in June, marking the start of a new growing season. The school celebrated with song and dance and an art show. For the art show, one […]

## Annotations in Twoville

Software for creating digital media tends to be driven by a mouse or stylus. The user directly manipulates shapes until they feel right. Twoville and Madeup, on the other hand, are programming interfaces for digital media. While code opens the door to algorithmic generation, programming interfaces tend not to give as much feedback as direct […]