Title: | Fractal Image Data Generator |
---|---|
Description: | Generates image data for fractals (Julia and Mandelbrot sets) on the complex plane in the given region and resolution. Benoit B Mandelbrot (1982). |
Authors: | Mehmet Suzen [aut, cre] |
Maintainer: | Mehmet Suzen <[email protected]> |
License: | GPL-3 |
Version: | 1.3.5 |
Built: | 2025-02-16 04:30:25 UTC |
Source: | https://github.com/msuzen/julia |
'JuliaImage' returns two dimensional array representing escape values from on the square region in complex plane. Escape values (which measures the number of iteration before the lenght of the complex value reaches to 2).
JuliaImage(imageN, centre, L, C)
JuliaImage(imageN, centre, L, C)
imageN |
Number of pixels to equally space division of one side if the square region. |
centre |
A complex number that determines the centre of the square region |
L |
A side length of the square region on the complex plane. |
C |
Complex coefficient |
Julia Set is defined as the set of initial complex values where the z = z^2 +C does not diverge to infinity. C is an arbitrary complex constant that does not change during the iteration by definition.
It returns a 2D array of real values from 0 to 1. The array correspods to image on the complex plane.
Post processing to plot/color mapping of the Julia set for visualisation can be done by using the array generated. See examples to get a png output.
Mehmet Suzen <[email protected]>
Gaston Julia (1918) "Memoire sur l'iteration des fonctions rationnelles," Journal de Mathematiques Pures et Appliquees, vol. 8, pages 47-245.
# # Generating png of the Julia set # C is 1 minus the golden ratio # imageN <- 5; # increase this to see images centre <- 0.0 L <- 4.0 C <- 1i-1.6180339887;# Golden Ratio image <- JuliaImage(imageN,centre,L,C); #library(png) #file <- "julia1.png" #writePNG(image,file); # possible visulation # # Generating png of the Julia set # different coefficient. # imageN <- 5; # increase this to see images centre <- 0.0 L <- 4.0 C <- -0.70176-0.3842i image <- JuliaImage(imageN,centre,L,C); #library(png) #file <- "julia2.png" #writePNG(image,file); # possible visulation
# # Generating png of the Julia set # C is 1 minus the golden ratio # imageN <- 5; # increase this to see images centre <- 0.0 L <- 4.0 C <- 1i-1.6180339887;# Golden Ratio image <- JuliaImage(imageN,centre,L,C); #library(png) #file <- "julia1.png" #writePNG(image,file); # possible visulation # # Generating png of the Julia set # different coefficient. # imageN <- 5; # increase this to see images centre <- 0.0 L <- 4.0 C <- -0.70176-0.3842i image <- JuliaImage(imageN,centre,L,C); #library(png) #file <- "julia2.png" #writePNG(image,file); # possible visulation
'JuliaIterate' returns the number of iteration until a complex value diverges for the Julia map for a give complex number.
JuliaIterate(z, C)
JuliaIterate(z, C)
z |
A complex coordinate (initial value for the map). |
C |
A complex constant. |
'JuliaIterate' returns the number of iteration until a complex value diverges for the Julia map for a give complex number.
Number of iterations.
Iterative function.
Mehmet Suzen <[email protected]>
The Fractal Geometry of Nature, Benoit B. Mandelbrot, W.H.Freeman & Co Ltd (18 Nov 1982)
JuliaIterate
and MandelIterate
z<-0+0i C <- 1-1.6180339887;# Golden Ratio it<- JuliaIterate(z,C)
z<-0+0i C <- 1-1.6180339887;# Golden Ratio it<- JuliaIterate(z,C)
'MandelImage' returns two dimensional array representing escape values from on the square region in complex plane. Escape values (which measures the number of iteration before the lenght of the complex value reaches to 2.)
MandelImage(imageN, centre, L)
MandelImage(imageN, centre, L)
imageN |
Number of pixels to equally space division of one side if the square region. |
centre |
A complex number that determines the centre of the square region. |
L |
A side length of the square region on the complex plane. |
Mandelbrot set is defined as the set of initial complex values where the z = z^2 +z_0 does not diverge to infinity. Initial value for the map is taken to be zero and z_0 is the complex coordinate.
Returns a matrix.
Returns a matrix
Mehmet Suzen <[email protected]>
The Fractal Geometry of Nature, Benoit B. Mandelbrot, W.H.Freeman & Co Ltd (18 Nov 1982)
# png image imageN <- 5; # increase this to see image centre <- 0.0 L <- 4.0 image<-MandelImage(imageN,centre,L); #file <- "mandelbrot1.png" # writePNG(image,file); # possible visualisation # Closer lookup to set imageN <- 5; centre <- -0.5 L <- 2.0 image<-MandelImage(imageN,centre,L); # file <- "mandelbrot.png" #writePNG(image,file); # possible visualisation
# png image imageN <- 5; # increase this to see image centre <- 0.0 L <- 4.0 image<-MandelImage(imageN,centre,L); #file <- "mandelbrot1.png" # writePNG(image,file); # possible visualisation # Closer lookup to set imageN <- 5; centre <- -0.5 L <- 2.0 image<-MandelImage(imageN,centre,L); # file <- "mandelbrot.png" #writePNG(image,file); # possible visualisation
'MandelIterate' returns the number of iteration until a complex value diverges for the Mandelbrot map for a give complex number.
MandelIterate(z_0)
MandelIterate(z_0)
z_0 |
A complex coordinate (constant coefficient value for the map) |
Iterate function.
Returns an integer
Iterate function
Mehmet Suzen <[email protected]>
The Fractal Geometry of Nature, Benoit B. Mandelbrot, W.H.Freeman & Co Ltd (18 Nov 1982)
JuliaIterate
and MandelIterate
z_0 <- 0-0.5i it <- MandelIterate(z_0)
z_0 <- 0-0.5i it <- MandelIterate(z_0)