Post Reply 
Fractal Plots
05-27-2019, 12:56 PM (This post was last modified: 05-27-2019 01:09 PM by Eddie W. Shore.)
Post: #1
Fractal Plots
Blog Entry:

The program CHAOS1 plots a fractal to simulate a Julia Set. Given the complex numbers z_k and c, repeats the equation:

z_n = z_n-1 + c^2

The program will ask for a sample graphing space with the a border B. The viewing window will be set up as:

Xmin = -B
Xmax = B
Ymin = -B
Ymax = B

The program CHAOS1 will also as for the number of points (G), this will determine the number of points plotted in the graph. The higher G is, the more detailed the fractal is; however, the plot will take longer to complete.

We start with each point on the graph z_0 = a + b*i, where i = √-1. Then we calculate:

z_1 = z_0^2 + c
z_2 = z_1^2 + c
z_3 = z_2^2 + c
and so on.

For each z_0, we have two possibilities for the repeated calculations:

1. |z_n| = abs(z_n) eventually goes towards infinity or

2. |z_n| = abs(z_n) eventually settles (or converges) to a specific point.

A color is assigned to each point z_0. The color is determined by the amount of iterations it takes to reach |z| > 2. For such points that fit criteria 2, and never reaches |z| >2, the point is colored black. This method creates the Julia set for any given c.

For the program CHAOS1, I set up a rank of colors to plot each point, and arbitrary pick a maximum amount of iterations. For example, I picked 9 colors for the TI-84 Plus CE version. Hence for each point, if |z| ≤ 2 after 9 iterations, color the point black.

Obviously the more levels (colors) we have, the more accurate our fractal is. With the programs listed, you can adjust the number of colors.

I set 18 color levels, starting from white to black. Because of the faster processor and calculating speed, I have increased the number of grid points to 500. 250 makes a picture with lines.

Note: I use the parenthesis notation (x,y) for the complex number x + yi because the imaginary character i unfortunately does not transfer to computer text.

// 2019-05-19 EWS
LOCAL b,g,c,l6,s;
LOCAL i,k,j,z,l;
{"Border: ","Grid: ","C: "},
{"Min/Max - X/Y",
"# Grid Pts",
"C: x + yi"});
// size the screen
Xmin:=−b; Xmax:=b;
Ymin:=−b; Ymax:=b;
// clear
// list of colors
// plotting
FOR i FROM −b TO b STEP (2*b)/g DO
FOR j FROM −b TO b STEP (2*b)/g DO

IF k==1 THEN
UNTIL ABS(z)>2 OR k==s;




Download the program (hpprgrm) here: (The zip file also has a version for the TI-84 Plus CE)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
Fractal Plots - Eddie W. Shore - 05-27-2019 12:56 PM

User(s) browsing this thread: 1 Guest(s)