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.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

756<br />

soh st<strong>and</strong>s for “sine equals opposite over hypotenuse.” “Opposite” refers to the<br />

side opposite the angle.<br />

cah st<strong>and</strong>s for “cosine equals adjacent over hypotenuse.” “Adjacent” is the side<br />

next to the angle.<br />

toa refers to “tangent equals opposite over adjacent.”<br />

You should also notice in the figure that tangent equals sine(θ) over cosine(θ). You may<br />

also remember that sine <strong>and</strong> cosine are similar when you graph them, both forming periodic<br />

waves—only the cosine wave is shifted a bit (90° or pi/2) on the graph, which is technically<br />

called a phase shift. I fully realize that it is a difficult to deal with this stuff in the<br />

abstract. Fortunately, there is another model used to visualize <strong>and</strong> study the trig functions:<br />

the unit circle (shown in Figure B-5).<br />

Figure B-5. The unit circle<br />

The unit circle is a circle with a radius of 1 unit in length—hence its imaginative name.<br />

When you work with the unit circle, you don’t use the regular <strong>and</strong> trusted Cartesian coordinate<br />

system; instead you use a polar coordinate system. The Cartesian system works<br />

great in a rectangular grid space, where a point can be located by a coordinate, such as<br />

(x, y). In a polar coordinate system, in contrast, location is specified by (r, θ), where r is the<br />

radius <strong>and</strong> θ (the Greek letter theta) is the angle of rotation. The unit circle has its origin<br />

at its center, <strong>and</strong> you measure angles of rotation beginning at the right-middle edge of the<br />

unit circle (facing 3 o’clock) <strong>and</strong> moving in a counterclockwise direction around it.

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

Saved successfully!

Ooh no, something went wrong!