Engineering Math - Fractal Theory

 

 

 

Julia Set

 

The Julia Set is a captivating object in the field of complex dynamics and fractal geometry, known for its intricate and infinitely detailed structure. Named after the French mathematician Gaston Julia, it emerges from the iterative behavior of complex functions, typically of the form f(z) = z2 + c, where z and c are complex numbers. What makes the Julia Set fascinating is its sensitivity to initial conditions - tiny changes in the value of c can produce vastly different visual patterns, ranging from connected, cloud-like figures to scattered dust-like structures. Studying the Julia Set not only reveals the beauty of mathematical visualization but also offers deep insights into chaos theory, stability, and the boundary between order and disorder in dynamical systems.

Build Up Intuition

Building intuition is essential when exploring complex mathematical systems like the Julia Set because the underlying equations, though simple, can lead to unexpectedly intricate and chaotic behaviors. Traditional formulas and static graphs often fall short in conveying the deep connection between parameters and outcomes. This interactive program provides a powerful way to develop such intuition by allowing users to directly manipulate the complex parameter c and observe how the fractal pattern responds in real time. By experimenting with values, zooming into fine details, and adjusting iterations, users can experience firsthand how small changes produce vast differences in structure - making abstract concepts more concrete and visually accessible. Through this kind of hands-on exploration, we move beyond theory into understanding.

Coordinates: (0, 0)
c = -0.40 + 0.59i

Controls

Complex Parameter (c)

-0.40
0.59

Zoom Controls

1x

Color Scheme

Iterations

200

Actions

Performance

FPS: 0

Shift Position

0
0

This is how you use (play with) this program

Features

The program draws one Julia set at a time on a 600 x 600 pixel canvas. At the default zoom, the canvas covers the square from -2 to 2 on both axes. Every control below changes one of three things: the parameter c, the part of the plane on view, or the colors.

  • Interactive Julia Set visualization
  • Real-time parameter adjustments
  • Multiple color schemes
  • Zoom functionality
  • Position shifting
  • Image saving capability
  • Coordinate tracking

Complex Parameter Control

The two sliders set c = a + bi. Each part moves in steps of 0.01 between -2 and 2. This is the only control that changes the set itself, and every other control changes only how you look at it. The default c = -0.40 + 0.59i is a special case, and the last section of this page explains why.

  • Adjust the "Real" slider to modify the real part of the complex parameter c.
  • Adjust the "Imaginary" slider to modify the imaginary part of the complex parameter c.
  • Current c value is displayed above the fractal.

Zoom Controls

Zooming shows whether the picture keeps its detail at smaller scales. Each click of + or - changes the zoom by a factor of 1.5. The mouse wheel zooms by about 10 percent towards the cursor. A drag draws a box, and the program then fills the canvas with that box.

  • Use the "+" button to zoom in.
  • Use the "−" button to zoom out.
  • Current zoom level is displayed between the buttons.
  • Regional Zoom : Zoom a certain area by Mouse Drag

Color Schemes

The color of a pixel shows how many iterations its starting point needed to escape, divided by the iteration count. Pixels that do not escape within the iteration count stay black in every scheme. So the scheme changes the look of the outside of the set, and the black part stays the same.

  • Choose from four different color schemes:
    • Rainbow
    • Fire
    • Ocean
    • Grayscale

Iteration Control

The iteration count is the number of times the program applies z2 + c to a pixel before it gives up and paints the pixel black. The slider runs from 10 to 1000 in steps of 10. A low count makes the black region too large, because slow points have no time to escape.

  • Adjust the iteration count using the slider.
  • Higher iterations result in more detailed fractals but may impact performance.

Additional Features

These controls help you record and move around, and none of them changes the set. The coordinate display sits in the lower left corner of the canvas and shows the point z under the cursor. The WebGL option has no effect in the current program. The canvas already uses a 2D drawing context, so the program cannot get a WebGL context and always computes the image on the CPU.

  • Save Image: Click the "Save Image" button to download the current view.
  • WebGL Toggle: Enable/disable WebGL rendering for performance optimization.
  • Position Shift: Use horizontal and vertical sliders to move the view.
  • Reset View: Click "Reset" to return to default settings.
  • Coordinate Display: Mouse position coordinates are shown above the fractal.

Tips

The tips below follow from the cost of the calculation. The program iterates every one of the 360000 pixels, so the time for one picture grows with the iteration count. The WebGL tip applies only after the program gets a working WebGL renderer.

  • Higher iteration counts provide more detail but may slow down rendering.
  • WebGL mode generally offers better performance on supported devices.
  • Experiment with different color schemes to highlight different aspects of the fractal.
  • Use the coordinate display to note interesting locations in the fractal.

How does the program decide which points belong to the Julia set ?

The picture looks like a drawing, but the program computes it one pixel at a time. Each pixel is a starting point z0. For that point, the program asks one question: does the orbit z0, z1, z2, ... stay bounded, or does it run away to infinity ?

Let's name the two sets involved. The filled Julia set K(c) holds every z0 whose orbit under zn+1 = zn2 + c stays bounded. The Julia set J(c) is the boundary of K(c). So the black region in the program approximates K(c), and the Julia set is the edge where the black meets the colors.

The program needs a test that proves an orbit will escape. The test is |z| > 2. Suppose |c| is at most 2 and |z| is larger than 2. Then |z2 + c| is at least |z|2 - |c|, which is at least |z|2 - |z| = |z| x (|z| - 1). This is larger than |z|, because |z| - 1 is larger than 1. So once an orbit leaves the disk of radius 2, it grows on every step and never returns. The program checks the same condition as zReal2 + zImag2 > 4, which avoids a square root.

The loop for one pixel therefore has two exits. If |z| passes 2 at iteration n, the pixel gets a color from n divided by the iteration count. If the loop reaches the iteration count first, the pixel is painted black. A black pixel is therefore a guess. It means the orbit did not escape in time, and a longer run may still show that it escapes.

Two details help when you compare the program with other pictures. First, the program maps the canvas row y to the imaginary part (y/600 x 4 - 2), so the imaginary axis points down. The picture for c therefore matches a textbook picture of the conjugate value. For example, c = -0.40 + 0.59i looks like the usual picture of c = -0.40 - 0.59i. Second, every K(c) is symmetric under a half turn about the origin. The reason is that (-z)2 + c = z2 + c, so z and -z land on the same point after one step.

The introduction mentions sensitivity to initial conditions. On this page it applies to the starting point z0, and it lives on the Julia set itself. Two starting points near J(c) can end up on opposite sides, one escaping and one staying bounded. That is why the edge has detail at every zoom level. Inside the black region, and far outside it, nearby points behave alike.

  • Each pixel is one starting point : the program iterates z2 + c from that point and records when the orbit escapes.
  • |z| > 2 proves escape : for |c| up to 2, an orbit that leaves the disk of radius 2 grows on every step.
  • Black means not escaped yet : the black region approximates K(c), and the approximation improves with the iteration count.
  • The imaginary axis points down : the canvas shows the mirror image of the usual orientation.

How does c change the shape of the Julia set ?

The introduction says that small changes in c can turn a connected figure into scattered dust. One test predicts that difference. It looks at the orbit of a single point, z = 0, and it needs no picture at all.

The point z = 0 is special because the derivative of z2 + c is 2z, which is zero only at z = 0. This point is called the critical point. A classical result of Julia and Fatou links it to the shape. If the orbit of 0 stays bounded, K(c) is connected. If the orbit of 0 escapes, K(c) breaks into infinitely many separate points, called Cantor dust. The values of c whose orbit of 0 stays bounded form the Mandelbrot set.

The table below applies the test to six values of c. The black pixel counts quoted after it come from the same escape-time rule as the program, on a 600 x 600 grid over the default view.

 

c

Orbit of z = 0

Filled Julia set K(c)

0

stays at 0

the unit disk, and J(c) is the circle |z| = 1

-1

0, -1, 0, -1, ... a cycle of length 2

connected, with a large black interior

i

0, i, -1+i, -i, -1+i, -i, ... bounded

connected, but with no interior: a thin tree-like curve

-2

0, -2, 2, 2, 2, ... bounded

the line segment from -2 to 2 on the real axis

0.3

escapes after 12 iterations

Cantor dust, with no black pixels at all

-0.40 + 0.59i

escapes after 267 iterations

Cantor dust, but it looks solid below 267 iterations

 

The default value c = -0.40 + 0.59i is the interesting case. The orbit of 0 escapes, but only after 267 iterations. At the default count of 200, the program never sees that escape. So it paints a solid black region, and the set looks connected. Let's check this with the iteration slider. With 200 iterations, about 15700 of the 360000 pixels stay black. With 300 iterations, about 9000 stay black. With 500, about 2900 stay black, and with 1000, only about 150 stay black. The black region dissolves, because the set really is dust.

Compare this with c = -1. Its orbit of 0 is a cycle, so K(c) is connected and has a real interior. With 1000 iterations, about 31800 pixels stay black, and more iterations do not remove them. The value c = i sits in between. K(c) is connected, but it has no interior, so almost no pixels stay black even though the set is one piece.

  • The orbit of 0 decides connectivity : bounded means one connected piece, and escaping means Cantor dust.
  • The Mandelbrot set is the map of connected Julia sets : it holds exactly the values of c for which K(c) is connected.
  • A solid black picture can mislead : the default c escapes after 267 iterations, so it looks connected at 200 iterations and dissolves above that.
  • Raise the iteration count to test a picture : a real interior stays black, and dust loses its black pixels.