# Sections of Mathematics to learning for art coding

**URL:** https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977
**Category:** Project Guidance
**Created:** [September 13, 2019, 10:53pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977 "2019-09-13T22:53:50Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![etlettering](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@etlettering](https://discourse.processing.org/u/etlettering)
#### Post date: [September 13, 2019, 10:53pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/1 "2019-09-13T22:53:50Z")

</div>

Dear passengers,

Can you describe me, please, what section of Math (like a trigonometry or discrete math or w.e.) I need to learn for good and deep understanding of art of coding on Processing?

It’s not a problem to learn a syntax for me. But, I’m really need a math workouts in a context of Creative Coding.

Some books, videos?  
Thank you!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [September 13, 2019, 11:03pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/2 "2019-09-13T23:03:20Z")

</div>

I think there are so many ways of generating Art by programming that there is not one section of math to learn

see [https://en.wikipedia.org/wiki/Generative\_art](https://en.wikipedia.org/wiki/Generative_art)

---

<div class="post-metadata">

### Author: ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)
#### Post date: [September 13, 2019, 11:36pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/3 "2019-09-13T23:36:32Z")

</div>

Its one big math problem with many many possible solutions, each dependant on what you want to accomplish with your code. Sometimes its easy to know what kind of code will solve your immediate problems without hindering the final destination. Other times, code can solve one problem but force you into a corner that wont allow reaching the goal. Read lots of code examples, modify it and understand what it does. Always ask yourself how that code you are reading might apply to your own projects.

---

<div class="post-metadata">

### Author: ![etlettering](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@etlettering](https://discourse.processing.org/u/etlettering)
#### Post date: [September 14, 2019, 7:13am UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/4 "2019-09-14T07:13:37Z")

</div>

Yes, I do it. But this does not contradict my desire to study the basic foundations of mathematics that I can apply Processing coding. So… what section of math is good for learning in this case?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [September 14, 2019, 7:32am UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/5 "2019-09-14T07:32:37Z")

</div>

> [@etlettering](#):
>
> what section of math is good for learning in this case?

JUST one example could be:  
understand this  
[https://processing.org/reference/environment/#Coordinates](https://processing.org/reference/environment/#Coordinates)  
processing basics,  
to use

> **[PVector / Reference](https://processing.org/reference/pvector)**
>
> A class to describe a two or three dimensional vector, specifically a Euclidean (also known as geometric) vector. A vector is an entity that has both magnitude and direction. The datatype, however, st…

with the learning of

> **[An introduction to vectors - Math Insight](https://mathinsight.org/vector_introduction)**
>
> A introduction to the concept of a vector as an object with magnitude and direction.

and use the examples

> **[Vector / Examples](https://processing.org/examples/vectormath.html)**
>
> Demonstration of some basic vector math: subtraction, normalization, scaling. Normalizing a vector sets its length to 1.

and tutorial

> **[PVector](https://processing.org/tutorials/pvector/)**
>
> An introduction to useing the PVector class in Processing.

or video  
[https://www.youtube.com/watch?v=7nTLzLf7jUg](https://www.youtube.com/watch?v=7nTLzLf7jUg) .

* * *

should be fun

---

<div class="post-metadata">

### Author: ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)
#### Post date: [September 14, 2019, 11:08am UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/6 "2019-09-14T11:08:37Z")

</div>

Coding math , best series tutorial outside of Dan Shiffman in my opinion.

[https://www.youtube.com/user/codingmath](https://www.youtube.com/user/codingmath), although not aimed at processing, everything he teaches can easily be incorperated into processing, through the use of PVector, or just applied math and is not language specific.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [September 14, 2019, 2:50pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/7 "2019-09-14T14:50:49Z")

</div>

> [@etlettering](#):
>
> what section of Math (like a trigonometry or discrete math or w.e.) I need to learn for good and deep understanding of art of coding on Processing

> [@etlettering](#):
>
> study the basic foundations of mathematics that I can apply Processing coding

If you look over the reference to the API, you will see a mix of things – there are a few trig terms, a number of mathematical operators, and a LOT of concepts from geometry.

> **[Reference](https://processing.org/reference/)**
>
> Find further documentation of the Processing language

If you had to pick one basic foundation area of math to explore – and you don’t have to pick just one! – it would probably be geometry, and basic linear algebra (vectors).

That said, creative coding can use any math. There are Processing forum posts and tutorials about:

- context free grammars
- machine learning
- cellular automata
- signal processing
- computer vision
- collision detection
- raycasting
- wave collapse
- fluid or softbody dynamics

These can use many different kinds of math – for example, the PeasyCam library implements a rotating camera uses quaternions.

A common thread for many examples is either perception or, more commonly, simulation. Some of the common forms of simulation – like collision detection / raycasting – get back to geometry and linear algebra in their implementation. Keep in mind that algorithms to approximate / compute equations are often quite different from mathematical equation solving and proofs – you might want to look at the actual code of parts of Processing and related libraries / examples / tutorials that you are interested in, in addition to reading about concepts.

Hope that was helpful.

---

<div class="post-metadata">

### Author: ![HackinHarry](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@HackinHarry](https://discourse.processing.org/u/HackinHarry)
#### Post date: [September 15, 2019, 1:34am UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/8 "2019-09-15T01:34:23Z")

</div>

Those are expert and learned responses. I had a minor aha moment once when I saw an equation with the Sigma(summation)and realized it was a for loop. The math equation is shorthand as is the code of a for loop.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [September 15, 2019, 7:32pm UTC](https://discourse.processing.org/t/sections-of-mathematics-to-learning-for-art-coding/13977/9 "2019-09-15T19:32:32Z")

</div>

There is a math section in the reference. Make yourself familiar with all examples there.

In the tutorials section check trigonometry primer and vectors, also arrays and two dimensional arrays. Of course the first three of the textual (!) tutorials are helpful.

Then in the examples there is swarm / boids. Maths is relatively simple there, it’s more how the rules play out. Definitely worth looking at.

Same goes for game of life.

As I said, it depends of the kind of Art you are looking for. Eg. Mandelbrot set / Julia set is very complicated and won’t help you in other fields.

Also Lorenz Attractor is complicated.

Also Fibonacci is nice, eg the curve.

Also check the principle of recursion, although not strictly maths.

See codes at (also English) [http://www.generative-gestaltung.de/1/](http://www.generative-gestaltung.de/1/)

See also: [https://github.com/Kango/MathProjects/wiki/Math-Projects](https://github.com/Kango/MathProjects/wiki/Math-Projects)
