# ofRandom vs ofNoise

Hello!

My first question in here

What is the main difference between noise and randomness?
Iāve noticed that the documentation isnāt completely done in some of the places, is where is the best place to learn little things like this?

Thanks!

For an ample answer to this question, I highly recommend you read the Introduction of Dan Shiffmanās āThe Nature of Codeā. The author made very good examples in Processing to demonstrate many kinds of ārandomnessā.

Enjoy!

1 Like

@daragao, a good place to look for this specific question would be at some of Daniel Shiffmanās descriptions. See the introduction of The Nature of Code - specifically section I.6 - or if you want to see him talk about it, check out his video on the topic. Heās talking about Processing, so the syntax is a little different, but the concept is the same.

As far as other questions go, it all depends on the question. Answers to questions about C++ are often a google search away. Some openFrameworks topics are covered by the tutorials on the site. Other topics - like this one - are general concepts that have been written up elsewhere on the web. Wish there were a more centralized source, but a google search combined with a search of the forum is a good start. And then, of course, posting here.

Hah - guess we were thinking of the same thing, though you happened to think a bit faster than I did

Thanks guys, sorry for the late reply, I didnāt comeback to check the answer, but that was actually what I did

1 Like

on thing to consider is that noise a ādeterministicā function, which means it returns the same thing with the same input, the way, for example, sin(0.2) always returns the same thing. random is non deterministic (unless you seed the random number generator) so it returns different results with the same inputs. In this way, noise is much more like a pure mathematical function (f(x)=y)ā¦

For me, the most simple and direct way to understand the difference between them is that you draw two circles in of, one circleās radius is controlled by ofRandom while the other circleās radius is controlled by ofNoise. The visual difference is quite obvious.

some code like this:

``````float noise=ofNoise(ofGetElapsedTimef());
float random=ofRandom(1);
ofCircle(ofGetWidth()/4, ofGetHeight()/2, 200*noise);
ofCircle(ofGetWidth()*0.75, ofGetHeight()/2, 200*random);``````