Sam Gilson

Circus Math Lab

Classroom tool

The Circus Math Lab is a companion page to Food Truck Circus, holding three toys written after Natural Math's way into mathematics: play first, functions as machines before formulas, and gentle calculus. Each one is driven by the same performer and the same physics as the game.

Plot a function

Draw a function by dragging its points, read it as a machine with x going in and f(x) coming out beside the change from row to row and the change of that change, or type a formula such as x^2, 2x+1, |x| or sin(x). The performer then plots it on the trampoline, and the top of each bounce marks one point, with back tucks, back pikes and tuck jumps on the way up.

Getting the performer to land on a point is itself the lesson in interpolation. A behaviour tree chooses how many beats to hold the push and the lean by imagining bounces in the game's own physics and interpolating between two that bracket the target, and the lab shows the tree and states its reasoning in words. The marks are then joined with straight lines or a smooth curve and drawn beside the original function, with the gap shaded and the largest and average error given.

Open the plotting lab

Popcorn under a flight

The performer jumps from a tall ledge, lands on the bed and bounces on to the grass. Every arc of that flight is a parabola, and the lab writes its equation in two forms.

In each strip of ground the performer drops a column of popcorn as tall as they are high at that moment, so the piles are a Riemann sum and counting kernels counts area. The lab sets the popcorn, the Riemann sum and a finely computed area side by side. The width of a strip and the point within it where the popcorn drops are both yours to change, which is where the method's error becomes visible. A match-a-curve control finds the jump whose flight best fits a typed curve by successive parabolic interpolation, fitting a parabola through three misses to find a better one.

Open the popcorn lab

Juggling patterns

Patterns are written as numbers, in siteswap, where each digit is how many beats a ball stays in the air and a larger digit is a higher throw. The lab checks whether a pattern can be juggled at all: the number of balls is the average of the digits, and no two balls may come down on the same beat. Where a pattern fails it says which rule it broke, draws the beat diagram, and the performer juggles the ones that work.

Open the juggling lab

Open the project · Source code

All tools and games