Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Motivation The Mandelbrot set is a set of complex numbers. When a certain recurrence relation is applied to the numbers outside the set, quickly approach

Motivation
The Mandelbrot set is a set of complex numbers. When a certain recurrence relation is applied to the numbers
outside the set, quickly approach infinity. The values for numbers inside the set remain finite. Near
the edge of the set, the speed at which the terms approach infinity varies wildly.
The recurrence relation is
zn+1=zn2+C
where z0=C and C is a complex number. As it turns out, if the size ?1 of zi exceeds 2 for some value of i, then
it can be shown that the terms will eventually become infinite. The value of i when zi exceeds 2 varies wildly for
values near the set members.
Plots of the Mandelbrot set can produce beautiful images. For this project, you will take an existing program that
plots the Mandelbrot set and parallelize it.
Existing Code
The program you are given is invoked as:
mandelPlot tlr tli real-side-length imag-side-length max-iterations
horizontal-pixels vertical-pixels image-file
It identifies whether the points within a rectangle of the complex plane are in the mandelbrot set by apply-
ing the recurrence relation above to each point. The coordinate of the top left point in the rectangle is:
tlr + tiiI. The length of each side in the real and complex plane is given by real-side-length and
imag-aide-length respectively. There is a one-to-one correspondance between the values tested for inclu-
sion in the Mandelbrot set and pixels in the graph that is created by the program. Hence the number of
points explored is horizontal-pixels*vertical-pixels and the distance between two points along any axis
is side-length/(pixels-1).
The recurrence relation given earlier is applied to each point in turn. At most max-iterations terms are
calculated. If after this number of terms the value is still below two, the point is taken to be in the set.
The program also plots the points through creation of a PPM file named image-file. The number of iterations
performed at a particular point determines its color in the final plot. The PPM file format specifies the number
of pixels in each row and column as part of a header written to the file. Following the header are three bytes for
each pixel that represent the red, green, and blue color values for the point. The value of each component must
be 255 or lower. The pixel positions are implicit; the color values are listed in row major order. The first color
value corresponds to the upper left corner of the image. The remaining colors are applied row wise until all the
points have been specified.
You can use the command
gi=p filename
to view the PPM files you create on a departmental Linux system.
?1 The size of zi is the length of the hypotenuse of a triangle where the sides are the complex and imaginar
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

3. Identify cultural universals in nonverbal communication.

Answered: 1 week ago