Fractals help
Overview Last lecture: Modules Variable scope Packages This time Work through results from the lab Additional problems
Task 1 Create a directory to store you new modules and packages Add the directory to your module path using the .bashrc file Write a module that when given a 2D array of 1 and 0s saves a pbm file to disk
Mandelbrot set: plotting module
Using the plotting module
Putting the module in the path On the Linux terminal: mkdir ~/python_bin export PYTHONPATH="${PYTHONPATH}:/home/users/tom00/python_bin" cp mypbm.py mypbm_backup.py # save a backup just in case mv mypbm.py ~/python_bin Make sure you do not duplicate modules. If you have one in your working directory and one in the PYTHONPATH which is the system using?
The Mandelbrot set
Koch snowflake Part 1 Koch curve
Order 2 Koch curve
Order n Koch curve
Snowflake
New task: Julia Sets For each c a Julia Set can be constructed. The Mandelbrot set acts as an index for the Julia set Based on the Mandelbrot code calculate the Julia set for c= 0.295 + 0.55i -0.74434-0.10772i -0.233+0.5378i 0.4+0.6i
Extra problems Write a code to evaluate the area of the Mandelbrot and Julia sets Add colour/grey scale to the Mandelbrot plot. The Julia set is not always connected, write a code to calculate a histogram for the size of domains.