cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Uncharted

Choose Language Hide Translation Bar
Craige_Hales
Super User
Mandelbrot shallow tour

JSL for the video.

picpath = ""; // "D:\Chales\pic\m";
//http://www.fractalforums.com/mandelbrot-and-julia-set/good-coordinates-for-mandelbrot-zooms/
//
//Points on the boundary of the Mandelbrot set generally have the most interesting orbits.  The easiest boundary points to compute are:
//
//* the spike along the negative real axis
//* the boundary of the main cardioid: r = (1 - cos(theta))/2, x = r*cos(theta)+0.25, y = r*sin(theta)
//* the boundary of the period 2 disk: r = 0.25, x = r*cos(theta)-1, y = r*sin(theta)
eps = 1.6; // slightly outside
deep = 10;
steps = 8000;
angle = 3;
scale = 2; // <<<<<<< video made with 20, very slow
xsize = 192 * scale;
ysize = 108 * scale;
diag = Sqrt( xsize ^ 2 + ysize ^ 2 );
mat = J( ysize, xsize, . );
New Window( "mandelbrot", bb = Border Box( Text Box( "wait" ) ) );
Wait( .2 );
num = 1e6;
For( t = 0, t < steps, t += 1,
	If( eps > 1e-9, eps *= .997 );
	deep += .3;
	angle += eps / 50;
	radius = (1 - Cos( angle )) / 2 + eps;
	x = radius * Cos( angle ) + 0.25;
	y = radius * Sin( angle );
	top = y - eps;
	bottom = y + eps;
	left = x - eps * xsize / ysize;
	right = x + eps * xsize / ysize;
	d = Floor( Min( 1e5, deep ) );
	Parallel Assign( {d = d}, mat[r( top, bottom ), c( left, right )] = Mandelbrot( d, 4, c, r ) );
	mat = mat / d;
	red = mat ^ .5;
	green = mat ^ 9;
	both = Loc( red :* green == 1 );
	red[both] = .1;
	green[both] = .4;
	blue = 1 - mat ^ .2;
	blue[both] = .1;
	img = New Image( "rgb", {red, green, blue} );
	(bb << child) << delete;
	bb << append( img );
	num += 1;
	If( picpath != "", img << saveimage( picpath || Char( num ) || ".png" ) );
	bb << updatewindow;
	Wait( 0 );
);

Last Modified: Mar 16, 2018 1:23 PM
Comments