Example Code

Draw your own fractal 2

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Description

I downloaded the Fractal.vi from Draw your own fractal from EFranz and I started playing with different UI options. I ended up changing the IMAQ Image for a 2D picture control (so that the Vision module is not required anymore) and adding an event structure, the Mandelbrot set, a zoom, and the ability to edit the palette using the color table generator.vi. The front panel is shown below.

 

Zooming in the different areas of the Mandelbrot and Julia sets can be fascinating. Enjoy.

Front panel - Mandelbrot.png

 

Interesting pattern can be found by zooming various areas. Below is an example of a zoomed area of the Mandelbrot set.

Mandelbrot set 3.png

 

And below is a Julia set using the default a and b parameters (need to zoom out and zoom in to get the full area):

Julia set2.png

 

Marc Dubois

www.harotek.com

Marc Dubois

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
alexderjuengere
Active Participant
Active Participant
on

When I commented 2 weeks ago on Draw your own fractal  I planned to do something you just did (more colors, zoom function etc.)

I didn't quite figure out, how to color the "inside" of the set properly, but YOU just took this piece of code to the next level!

I am looking forward to take a ccloser look at your vi

MarcDub
Active Participant
Active Participant
on

Thanks. The core of the calculations remained about the same. I used the code to test out a few user interface features (zoom, context menus,...).

I had played with the Mandelbrot and Julia sets back when I was an undergraduate. Now, with the calculations taking 10's or seconds instead 10's of minutes, it is easier to explore the sets.

I found an elephant

Mandelbrot set 5 (elephant) half.png

and a mushroom

Mandelbrot set 4 (mushroom) half.png

Marc Dubois