Random Number Functions

Home • Gallery • Tutorials • Download • Purchase • Site Map

Random Number Functions Support

The following Fractal Science Kit fractal generator functions support random number generation:

void Random.Seed(seed)
Random.NumberInRange(min, max)
Random.IntegerInRange(min, max)
Random.ComplexNumberInRange(min, max)

Each set of program instructions has access to a random number stream that is shared among the different sections within a given set of program instructions but not with any other programs.

Random.Seed sets the seed of the random number generator to the given seed which should be an integer. Random.Seed is often used to generate a repeatable sequence of random numbers by using a fixed seed value. Typically, Random.Seed is called once in the global section of your program or not called at all in which case a time-dependent default seed value is used. Random.Number returns a random floating point value between 0 and 1 (0 <= value < 1). Random.NumberInRange returns a random floating point value between min and max (min <= value < max). Random.Boolean returns True or False at random. Random.Integer returns a random integer value from 0 to n-1 (0 <= value < n). Random.IntegerInRange returns a random integer value from min to max-1 (min <= value < max). Random.ComplexNumber returns a random complex value where the real and imaginary components are between 0 and 1 (0 <= value < 1). Random.ComplexNumberInRange returns a random complex value in the rectangle defined by the points min and max; i.e., min.R <= value.R < max.R and min.I <= value.I < max.I. Random.PointInUnitDisk returns a random point in the unit disk; i.e., the circle of radius 1 centered at the origin.


Copyright 2004-2019 Ross Hilbert
All rights reserved