A Simple Stochastic Fractal


If you can read this, then your browser is not set up for Java. . .

This applet generates a simple stochastic fractal. It maps points (x,y) on a plane. You can think of the center of the applet screen as being (0,0). It plots 150,000 points in an area that covers 400 pixels x 400 pixels on your computer screen (i.e. a total of 160,000 pixels).

First a random number ("ran") between 0 and 1 is selected. If ran is greater than or equal to 1/2, then we rotate the current (x,y) point 90 degress to the left, and plot a new point. If ran is less than 1/2, then, depending on the distance of (x,y) from (1,0), we expand or contract the values of x and y with respect to (1,0).


Here is the java source code.