The randomization methods take two Vector
as parameters topLeft
and bottomRight
which are used to bound the generated random values.
On this page you can drag the topLeft
and bottomRight
vectors to
change the bounds as well as the v1
vector on which we call the .randomizeX
, .randomizeY
and .randomize
methods. Each time
these vectors are changed, the page generates 10 vectors to show a sample of output of the methods.
You will notice that the results of .randomizeX
all keep the same .y
value as v1
but have a .x
value between the .x
properties
of topLeft
and bottomRight
.
Similarly the results of .randomizeY
all keep the same .x
value as v1
but have a .y
value between the .y
properties
of topLeft
and bottomRight
.
Finally, the results of .randomize
are independent from the properties of v1
and only depend on the .x
and .y
properties of topLeft
and bottomRight
.
Input
v1
topLeft
bottomRight
v1.randomizeX(topLeft, bottomRight)
topLeft
bottomRight
random 1
random 2
random 3
random 4
random 5
random 6
random 7
random 8
random 9
random 10
Input
v1
topLeft
bottomRight
v1.randomizeY(topLeft, bottomRight)
topLeft
bottomRight
random 1
random 2
random 3
random 4
random 5
random 6
random 7
random 8
random 9
random 10
Input
v1
topLeft
bottomRight
v1.randomize(topLeft, bottomRight)
topLeft
bottomRight
random 1
random 2
random 3
random 4
random 5
random 6
random 7
random 8
random 9
random 10