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 />

748<br />

Appendix B includes mathematical concepts <strong>and</strong> code examples that didn’t quite fit within<br />

earlier sections of the book, but nonetheless could be useful <strong>and</strong> hopefully interesting for<br />

creative coding.<br />

Algebra<br />

We use the term literate to describe a person fluent in the use of a natural language. The<br />

term numerate describes a similar fluency with math, <strong>and</strong> algebra is first <strong>and</strong> foremost at<br />

the core of that fluency. Programming <strong>and</strong> algebra have a close relationship, as they both<br />

utilize expressions composed of symbols. Following are some h<strong>and</strong>y rules <strong>and</strong> procedures<br />

fundamental to algebra <strong>and</strong> programming.<br />

Adding negative numbers<br />

Adding two negatives results in a larger negative:<br />

Here’s another (simpler) way to write the previous expression:<br />

Subtracting negative numbers<br />

Subtracting by a negative is like adding:<br />

Multiplying negative numbers<br />

Multiplying two negatives creates a positive:<br />

Dividing by zero<br />

You can’t do it!<br />

Multiplying fractions<br />

Multiply the two numerators <strong>and</strong> two denominators:

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

Saved successfully!

Ooh no, something went wrong!