Skip to content

Latest commit

 

History

History
273 lines (166 loc) · 6.5 KB

README.md

File metadata and controls

273 lines (166 loc) · 6.5 KB

Fractals in the polar coordinate.

It is fork of the original code by Mika Seppä

Description

Original image (FractExample5.png)

FractExample5.png

Modified images

  • crop = Cutout = cut ( defining a rectangle in pixels and choose only this rectanle, removing the other parts of an image). Why : because most of image is not interesting exterior of Mandelrots/Julia sets

Here is standard c plane ( flat image = rectangle from Cartesian plane) with marked part of the plane which is showed in the polar image

example5_flat

Mandelbrot set ( polar images)

Image ( example5)

FractExample5.png

xSize=8000
ySize=800
./pfract -x 0.160211 -y -0.684246 -size $xSize $ySize -iterations 256 -rad -10 example5.raw
./colorize example5.raw example5.ppm -spawn -400 -scale 1.6 -fadedepth 25

New image ( example 7): only one minibrot from above image, more distorted

example7.png

xSize=8000
ySize=800
./pfract -x 0.360211 -y -0.684246 -size $xSize $ySize -iterations 256 -rad -10 example7.raw
./colorize example7.raw example7.ppm -spawn -400 -scale 1.6 -fadedepth 25

New image ( example 8): more cetered zoom, different diatorsion of decorations

example8.png

xSize=8000
ySize=800
./pfract -x 0.360211 -y -0.57 -size $xSize $ySize -iterations 256 -rad -10 example8.raw
./colorize example8.raw example8.ppm -spawn -400 -scale 1.6 -fadedepth 25
convert example8.ppm example8.png
# crop the image with shotwell

Here is an example how number of iterations ( -iterations) can change the image: for the first one is 256 and for the second one is 20000 ( see also commons and wikibooks):

e9.png 1.786440255563638.png

./pfract -x -1.7864402555636389  -y 0 -size $xSize $ySize -iterations 256 -rad -20 e9.raw
./colorize e9.raw e9.ppm -spawn -400 -scale 1.6 -fadedepth 25
convert e9.ppm e9.png
# crop the image with shotwell
./pfract -x -1.786440255563638  -y 0 -size 2400 800 -iterations 20000 -rad -20 1.786440255563638.raw
./colorize 1.786440255563638.raw 1.786440255563638.ppm -spawn -400 -scale 1.6 -fadedepth 25
convert 1.786440255563638.ppm 1.786440255563638.png

1.732000000000000.png

1.749694500000000.png

1.785700000000000.png

Julia sets ( polar images)

FractExample1.png

FractExample2.png

FractExample3.png

FractExample4.png

FractExample6.png

Exponential map and polar coordinate

Compilation and execution of the program

sfp

Single file program ( sfp) - only 1 c file with 250 lines:

  gcc p.c -lm -Wall -Wextra 
  ./a.out

bash version

My version of the program can be compiled and run with simple

make

or

./r.sh

Detailes are in

Original code execution

pfract -julia -cx -1.115313 -cy -0.304872 -x -0.147394 -y -0.234163 -size 1600 160 -iterations 164 -rad -8 example1.raw
colorize example1.raw example1.ppm -fadedepth 20 -scale 1.4

Files

Source code

Raw file specification

  • binary file
  • contains data
 0- 7 : Magic number "ITERFILE"
 8- 9 : Image width
10-11 : Image height
12-13 : Number of bytes per iteration value (NBYTES)

IF NBYTES=2:
14-15 : Maximum iterations
16-   : Data (2 bytes per iteration value)

IF NBYTES=4:
14-17 : Maximum iterations
18-   : Data (4 bytes per iteration value)

see also

To do

  • show on normal plane what part of that plane is transformed
  • make one file c program (sfp = Single File Program). I think that because of short compiling and running time of original code there is noneed for dividing cration of the image into steps)
  • modify the program to show more image to the left
  • make program specification

Git

create a new repository on the command line

echo "# PFRACT" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:adammaj1/PFRACT.git
git push -u origin main

Repo

Change:

  • in general settings
    • add Social Preview Image ( Images should be at least 640×320px (1280×640px for best display))
  • in repository details ( near About) add
    • description
    • website
    • Topics (separate with spaces)

Local repository

/Dokumenty/algorithm/pfract

Subdirectory

mkdir png
git add *.png
git mv  *.png ./png
git commit -m "move"
git push -u origin main

then link the images:

![](./png/n.png "description") 

to overwrite

git mv -f 
git mv ./src/*.c ./src/modified/bash/
git mv ./src/*.sh ./src/modified/bash/
gitt mv ./src/Makefile ./src/modified/bash/

Github