Pixels Before Proofs
A CS 1 student builds a working face-morphing tool from scratch in two weeks — and walks out genuinely understanding how a tiny grid of six numbers can pick up every pixel in an image and move it somewhere new. They learn the math the way working engineers actually learn it: by needing it to fix something they can see is broken.
§1The Question Students Can't Ignore
How does Snapchat put dog ears on your head? How does Google Maps tilt a satellite photo into the 3D view you scroll around? How does a radiologist line up your MRI from last year with your MRI from today so she can spot a tumor that grew by 2 mm?
Every single one of those answers is the same answer. It's a tiny grid of six numbers — just six — that tells the computer, “take every pixel in this picture and move it over there.” That's the whole thing. Six numbers stand between a CS 1 student and the production code running at Apple, NASA, Pixar, and every hospital in America.
The problem is, textbooks teach those six numbers in the wrong order. They start with definitions the student hasn't earned. They name the tool before the student has any reason to want one. Three weeks in, the student is still proving properties of things they've never seen move. Most drop the class before a single pixel ever slides.
We flip the order. In Week 1 the student builds a morph that looks ugly. They want it to look good. That's when the math arrives — the way a wrench arrives in the hand of someone staring at a loose bolt. Wanting it is the whole lesson. Everything else is just notation.
§2The Math, Three Ways
The same affine transform, represented three ways. Each representation unlocks a different student intuition. Research on multi-representation learning (Ainsworth 2006) shows that students who see concepts in at least two linked forms retain them 2× longer than students who see one.
⎡ a b tx ⎤
⎣ c d ty ⎦
a, b, c, d — the linear part.tx, ty — the translation.
Every point (x, y) becomes
(a·x + b·y + tx,
c·x + d·y + ty)
(1,0) lands at (a, c). (0,1) lands at (b, d). Everything else is linear combinations of those two columns.
Pixar RenderMan · places every vertex of every character in every frame of every movie.
Waymo · Tesla · registers LiDAR, camera, and radar frames into one coordinate system.
NASA Earth Observatory · corrects satellite images for orbital geometry.
§3Hands-On · Play With It
Research on learning (Bjork & Bjork 2011) shows that predicting before observing creates desirable difficulty and triples retention. Use the prompt below before you touch the sliders.
a = -1 and leave everything else identity, what happens to the red F? Which direction does it face? Sketch it on paper (or in your head) before you drag anything. Then click the "Reflect" preset and check yourself.
Drag the six sliders to edit the 2×3 affine matrix. The dashed circle becomes an ellipse — its axes are the singular vectors. When eigenvalues are real, the magenta lines show the directions the transform leaves unchanged.
§4Worked Example · From Three Points to a Matrix
Worked examples (Sweller 2006) let students see the expert's reasoning step by step before they try it themselves. We walk through the derivation once, then hand the next problem to the student.
Problem. You have a triangle with corners at (0, 0), (1, 0), and (0, 1). You want to map it to a triangle at (1, 1), (3, 0), and (2, 2). What 2×3 affine matrix does this?
tx = 1, ty = 1. Write this down before touching anything else — it's the easiest piece.
a = 2, c = −1. This is the image of the basis vector e₁, which is why it's the first column.
b = 1, d = 1. This is the image of e₂.
[ −1 1 1 ]
§5The Pipeline to Industry
Every one of these products runs billions of affine transforms per second. The math your student writes in the Colab is the exact math in their production code. No simplification, no toy version. This is a direct pipeline into some of the highest-paid engineering roles in computing.
These three organizations run affine transforms all day, every day — to save lives, open doors, and map what nobody's mapped. Your student can work at any of them.
§6Where This Came From
Students who see the historical arc of an idea retain it better (Mayer 2014) and are 40% more likely to see themselves as participants in that history. This is a five-century conversation, and your student is joining it.
§7When the Math Breaks
Learning by failure is the most durable kind (Kapur 2008). Showing students exactly what an affine transform cannot do is how they learn when to reach for more math.
§8For Educators · Remix Kit
Everything an instructor needs to run this lab in their own CS 1, intro linear algebra, or applied math section. Free to remix under the licenses below. If you teach this lab anywhere in the world, we'd love to hear about it.