04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>and</strong> began doubling. By step 80, the output had surpassed the diameter of the known universe—but<br />

it goes way beyond that. In fact, each step from 80 to 100 is another doubling<br />

in size—my head’s beginning to hurt, <strong>and</strong> I think you get the point.<br />

Trigonometry<br />

COMPUTER GRAPHICS, THE FUN, EASY WAY<br />

The Latin word trigonometry, coined in the 16th century, was formed from three Greek<br />

words that translate to “three-angle measure,” <strong>and</strong> simply means the study of triangles.<br />

This is precisely what trig was used for in the second century BC, when the astronomer<br />

Hipparchus of Rhodes created one of the first tables of trigonometry values (it was called<br />

a table of chords back then). Unfortunately, most of Hipparchus’s work has been lost, <strong>and</strong><br />

we mostly know of him through the writings of others, especially Ptolemy, who based<br />

much of his work on Hipparchus’s earlier work. Ptolemy, you may remember, is the guy<br />

who said that Earth was at the center of the universe, which was eventually refuted by<br />

Copernicus 1,400 years later. Hipparchus apparently used his chord tables to help him predict<br />

things like eclipses, star positions, distance to the moon, <strong>and</strong> the length of a year,<br />

which he predicted to within 6.5 minutes. I think it’s time we give Hipparchus his due.<br />

Hipparchus’s reputation aside, solving for angles <strong>and</strong> sides of triangles is not terribly inspiring,<br />

<strong>and</strong> precisely what contributed to my dazed stare out the classroom window when I<br />

first studied it. Since ancient times (even before I was in junior high school), trig has<br />

emerged as a fundamental tool in many fields, from astronomy to architecture to engineering<br />

to 3D gaming, <strong>and</strong> yes, also to code art. Trig is much more than the study of triangles;<br />

it figures significantly in the study of waves, impacting our underst<strong>and</strong>ing of sound,<br />

radio, <strong>and</strong> light, among other physical phenomena.<br />

Trigonometry is also really simple. I know this may sound odd, but aside from having to<br />

learn a couple scary Greek symbols <strong>and</strong> basic theory, trig is really just an extension of the<br />

Pythagorean theorem (at least the part of trig you’ll need). Although some basic theory is<br />

helpful to begin to grasp the full power of trigonometry, it is possible to begin playing with<br />

the trig functions almost immediately, learning experientially as you experiment with<br />

them. The trig functions that you’ll mostly use are sine, cosine, <strong>and</strong> tangent. There are a<br />

few others you’ll look at later on in the book, but an amazing amount of stuff can be done<br />

with just these three.<br />

I like to think of the trig functions almost as dabs of paint on my palette. I begin playing<br />

with the trig dabs, inserting different values here <strong>and</strong> there, <strong>and</strong> watching what happens.<br />

Sometimes I end up with really long <strong>and</strong> convoluted expressions, completely outside of my<br />

underst<strong>and</strong>ing, that make engaging, beautiful images or animations; other times I get a<br />

garbled mess. Part of the fun is in not exactly knowing what you’re going to get.<br />

Fortunately, as an artist, I can get away with this aesthetically driven, semi-clueless<br />

approach to trig. I also can’t help wondering, had math been taught this way when I was in<br />

school, perhaps I would have enjoyed math class more <strong>and</strong> done less window gazing.<br />

Interestingly, as I’ve gotten older, I’ve found the more I play with stuff like trig, the more<br />

interested I get in underst<strong>and</strong>ing the underlying theory. I also think this aesthetic approach<br />

to learning math increases retention, especially for artists.<br />

131<br />

4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!