Explore Random Art

Description

The MathArt interface has a set of Random Checkboxes.

Random Checkboxes

Computer(left) Ipad(right)

Javascript Math.Random()

The Math.random() function returns a floating-point,
pseudo-random number in the range 0–1
(inclusive of 0, but not 1)


The MathArt Function

function getRandom(min, max) {
var mynum = Math.random() * (max - min) + min;
mynum = Math.floor(mynum);
return mynum;
}

MathArt uses the function like this:

rotate = getRandom(1, 360);

scale = getRandom(1, 200);
scale = scale /100;

skewX = getRandom(1, 80);
skewY = getRandom(1, 80);

Horizontal = getRandom(-900, 900);
Vertical= getRandom(-900, 900);

Can you explain why MathArt uses this code?

Continue