GithubHelp home page GithubHelp logo

adammaj1 / pfract Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5.2 MB

FRACTALS IN POLAR COORDINATES, It is fork of original code by Mika Seppä

Home Page: http://neuro.hut.fi/~mseppa/images/Fract.html

C 91.70% Makefile 0.05% Shell 8.25%
c mapping geometric-transformations computer-graphics-algorithms geometric-transformation complex-numbers mandelbrot mandelbrot-computing mandelbrot-fractal mandelbrot-set

pfract's Introduction

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

pfract's People

Contributors

adammaj1 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.