Chapter Questions

<aside> šŸ§Ÿ Ask your TWO questions about the Random chapter below. Please, include your name.

</aside>

  1. Are there any benefits to the p5 noise(x) function using Perlin noise as opposed to Simplex noise if Simplex noise is newer and faster? (CHRIS Kim)
I read this question and thought "maybe it does use simplex noise?" so i looked in the code.

<https://github.com/processing/p5.js/blob/e32b45367baad694b1f4eeec0586b910bfcf0724/src/math/noise.js>

//////////////////////////////////////////////////////////////

// <http://mrl.nyu.edu/~perlin/noise/>
// Adapting from PApplet.java
// which was adapted from toxi
// which was adapted from the german demo group farbrausch
// as used in their demo "art": <http://www.farb-rausch.de/fr010src.zip>

// someday we might consider using "improved noise"
// <http://mrl.nyu.edu/~perlin/paper445.pdf>
// See: <https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/>
//      blob/main/introduction/Noise1D/noise.js

nope. sounds like oldschool perlin noise.

is suspect that the key reason perlin noise was used was that an adaptable implementation was handy.

How can we use other noise functions in p5, would we have to set up a new function for that particular noise function? (Chris Kim)

you could choose an existing function, study it, and implement it yourself.
you could find an implmentation and copy/paste it
you could find a javascript noise library and use it (along side p5)
  1. I know we talked about hacking and such as a reason why we might not want to do this, but is there a way to find the initial seed used when we use random( ) or noise( ) in p5, for example, if we get a sketch that we like the outcome of and want to repeat? (Chris Kim)
i don't think p5 lets you ask what the seed was, but it does let you set the seed yourself. 

so you could do something like this

function setup() {
	const seed = **pick a seed somehow**
	console.log("seed is:" seed);
	randomSeed(seed);
}

  1. I had a similar question that Chris asked about the use of Perlin noise vs. other types of noise. If we were to implement them into our work, would our only options either be to find an existing implementation or find a library that supports other types of noise generation? (John Kim)
or write your own implementation of an existing algo, or invent your own!
  1. Iā€™m not sure if Iā€™m fully grasping the overarching differences between random() and noise(). Does the noise() function serve as a method of creating a more controlled random output? Or is there more than just the visual differences and the extra control we have over the output? (John Kim)
this will be a major point for this friday. But bring this up if it isn't answered then.

What is the difference between the noise() and random() functions in terms of their arguments and return values? (Juli Serna)

random() without arguments returns a number between 0 and 1 at random
random(1,2) with arguments scales that number to the range provided

noise() does not offer any way to scale the return value, it always returns numbers in the range 0 to 1, which you can then scale and shift with math

noise() does take parameters, but those parameters are the address of which "number from the cloud of numbers" should be returned

again, this is a core point, and we'll talke about it in class