algorithmic modeling for Rhino
Tags:
Pseudo-random numbers are chosen with equal probability from a finite set of numbers. The chosen numbers are not completely random because a definite mathematical algorithm is used to select them, but they are sufficiently random for practical purposes. The current implementation of the Random class is based on Donald E. Knuth's subtractive random number generator algorithm. For more information, see D. E. Knuth. "The Art of Computer Programming, volume 2: Seminumerical Algorithms". Addison-Wesley, Reading, MA, second edition, 1981.
randomNumberX = (rndMax - (rndMin + 1)) * (randomClass.NextDouble() + rndMin)
randomNumberY = (rndMax - (rndMin + 1)) * (randomClass.NextDouble() + rndMin)
randomNumberZ = (rndMax - (rndMin + 1)) * (randomClass.NextDouble() + rndMin)
Dim pt As New On3dPoint(x + RandomNumberX, y + RandomNumberY, z + RandomNumberZ)
' Reset the random-number generator and provide a seed value for subsequent calls To Rnd
Rnd (-1)
Randomize 2
For i = 0 To max
arrDbl(i) = Rnd
Next
For j = 0 To max Step 3
Call Rhino.AddPoint(Array(arrDbl(j), arrDbl(j + 1), arrDbl(j + 2)))
Next
The current implementation of the Random class is based on Donald E. Knuth's subtractive random number generator algorithm. For more information, see D. E. Knuth. "The Art of Computer Programming, volume 2: Seminumerical Algorithms ". Addison-Wesley, Reading, MA, second edition, 1981.
Not sure if after 10 years A) anyone will be checking this out or if B) the psudo random algorithm at the base of the Grasshopper Random component has changed. But.
In the attempt of generating a randomly distributed pointcloud, a clearly discernable hyperplanes pattern emerged from the combination of three Random components, each outputting a list to feed the three spatial coordinate.
The three random components share the same Domain and Number inputs, but the Seeds are unique. When the seeds are three consecutive numbers [n] [n+1] [n+2] , the resulting points are arranged in three coplanar groups.
As the third seed increases while the first two are fixed, the number of hyperplanes planes linearly increases by steps of 2.
[n] [n+1] [n+2] > 3
[n] [n+1] [n+3] > 5
[n] [n+1] [n+4] > 7
...
By swapping random coordinate lists in the Point3D inputs, the planes rotate around the average value of all the XYZ point coordinates.
Still not having digged into Linear Congruential Generators, yet definetevely interesting the order emerging from (pseudo) randomness.
I attach screenshots of a test with the following input parameters:
Domain: -10 to 10
Number: 10000
Seeds: 0,1,2
Best,
Hi Marco,
so nice to see that this thread is relevant after more than 10 years! Unfortunatly, the original example mentioned above by Daniel A. Becker is not online anymore. There are however still images and documentation out there, e.g.: at https://www.slanted.de/beitrag/random-walk-die-visualisierung-des-z... or https://www.daniel-a-becker.de/?page_id=58. A short summary in English can be found here: http://www.visualcomplexity.com/vc/project.cfm?id=676.
Would you like to add your GH definition to your post, so that we can reproduce the effect?
Best,
Tobias
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by