# teaching machines

## Polar Graph

A year ago I decided to see if fifth graders could create shapes using polar coordinates. I bet myself that they could if we spent some time first traversing a polar grid, identifying the labels of the rings and the spokes. We didn’t think of them as angles and radii, because those semantics weren’t important to us. We just needed a mechanism for addressing locations on the grid.

I looked around on the internet for a polar graph paper that the students could draw on, but I wasn’t satisfied with my options. Few had labels, and I dreaded the prospect of adding them in by hand. An algorithm—not me—would be the appropriate laborer. To Twoville I turned and produced this graph:



ringCount = 10
ringDelta = 10
spokeDelta = 10

with viewport
center = [0, 0]
size = [outerRadius * 2 + 50, outerRadius * 2 + 50]

// Rings, small to big.
for i in 1..ringCount
with circle()
center = [0, 0]
color = :black
opacity = 0
stroke.color = :black
stroke.size = 0.2
stroke.opacity = 1

// Spokes.
for i to 360 by spokeDelta
degrees = i
with label()
position = [1.1 * x, 1.1 * y]
color = :black
text = degrees
with rotate()
pivot = [1.1 * x, 1.1 * y]
degrees = degrees
with line()
vertex().position = [0, 0]
vertex().position = [x, y]
color = :black
color = [0, 0, 0]
size = 0.4

var twovilleDiv = jQuery('#twoville_polar');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_polar').submit();

ringCount = 10
ringDelta = 10
spokeDelta = 10

with viewport
center = [0, 0]
size = [outerRadius * 2 + 50, outerRadius * 2 + 50]

// Rings, small to big.
for i in 1..ringCount
with circle()
center = [0, 0]
color = :black
opacity = 0
stroke.color = :black
stroke.size = 0.2
stroke.opacity = 1

// Spokes.
for i to 360 by spokeDelta
degrees = i
with label()
position = [1.1 * x, 1.1 * y]
color = :black
text = degrees
with rotate()
pivot = [1.1 * x, 1.1 * y]
degrees = degrees
with line()
vertex().position = [0, 0]
vertex().position = [x, y]
color = :black
color = [0, 0, 0]
size = 0.4



Who needs a collection of 100 different versions of polar grid paper when you can have just one expressed parametrically?

The fifth graders managed just fine.