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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PROCESSING: CREATIVE CODING AND COMPUTATIONAL ART<br />

248<br />

First three values: 14.1, 15.2, 16.3<br />

Last three values: 159.3, 160.4, 161.5<br />

As you can see, the change between any two consecutive values will always be xSpeed<br />

(1.1). In contrast, y is incremented by the constant 1.02 using multiplication. This is called<br />

a geometric progression. Here are the first <strong>and</strong> last three values in this progression:<br />

First three values: 13.26, 13.53, 13.80<br />

Last three values: 181.04, 184.66, 188.35<br />

The difference between any consecutive values will no longer be a constant value throughout<br />

the entire progression. This change in speed generates a curve. Let’s alter some values<br />

in the curve plot to see how it effects the curve (see Figures 7-7 <strong>and</strong> 7-8):<br />

float xSpeed = .5, ySpeed = 1.02;<br />

Figure 7-7. Faster falling curve<br />

float xSpeed = 6.6, ySpeed = 1.11;

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

Saved successfully!

Ooh no, something went wrong!