dzielić się – kopiować, rozpowszechniać, odtwarzać i wykonywać utwór
modyfikować – tworzyć utwory zależne
Na następujących warunkach:
uznanie autorstwa – musisz określić autorstwo utworu, podać link do licencji, a także wskazać czy utwór został zmieniony. Możesz to zrobić w każdy rozsądny sposób, o ile nie będzie to sugerować, że licencjodawca popiera Ciebie lub Twoje użycie utworu.
na tych samych warunkach – Jeśli zmienia się lub przekształca niniejszy utwór, lub tworzy inny na jego podstawie, można rozpowszechniać powstały w ten sposób nowy utwór tylko na podstawie tej samej lub podobnej licencji.
#include<complex.h>#include<math.h>#include<stdio.h>#include<stdlib.h>#include<omp.h> //OpenM/*fork of mandelbrot-book how to write a book about the Mandelbrot set by Claude Heiland-Allehttps://code.mathr.co.uk/mandelbrot-book/blob/HEAD:/book/-----------------------------------------------------hobold: Let's remove the iteration bands and change the relative sizes of black and white checkerboard areas. Now the structural similarity is more emphasized.https://fractalforums.org/fractal-mathematics-and-new-theories/28/plotting-field-lines-during-iteration/4233The white curve in my first image is a polyline connecting the (numerically approximated) corners of the checkers of some specific iteration band. I believe the limit was 27 iterations before the smallest "square" became too tiny to distinguish adjacent vertices with double precision.The pattern in the 2nd image was done by looking at the final value of the iterated Z_n, just after it escapes. The usual checkerboarded "binary decomposition" looks at just the sign of the imaginary part. But you really can choose any axis through the origin and color based on what side of the axis you end up on. Or you can choose a sector smaller than 180 degrees like I did:Code: [Select]return (fabs(z.x)*0.1 < fabs(z.y));The bailout radius needs to be reasonably large for those field lines to align nicely between iteration bands. Because this analogy with field lines is only strictly true for an infinite bailout. So with a minimal bailout radius of 2.0, the binary decomposition ends up being very visibly distorted and misaligned.------------------------------------------------------------------------gcc m.c -lm -Wall -Wextra -fopenmp./a.out >f.pgm*/doublecnorm(double_Complexz){returncreal(z)*creal(z)+cimag(z)*cimag(z);}intmain(){//int aa = 4;intw=2000;// width in pielsinth=2000;// height in pixelsintkMax=1024;// iteration maxdoubler=2;// plane radius: https://en.wikibooks.org/wiki/Fractals/Computer_graphic_techniques/2D/plane#radius// The bailout radius needs to be reasonably large for those field lines to align nicely between iteration bandsdoubleER=2000;// Escape Radius = bdoubleER2=ER*ER;// escape_radius^2unsignedchar*img=malloc(w*h);#pragma omp parallel forfor(intj=0;j<h;++j){doubley=(h/2-(j+0.5))/(h/2)*r;for(inti=0;i<w;++i){doublex=(i+0.5-w/2)/(h/2)*r;double_Complexc=x+I*y;double_Complexz=0;intk;for(k=0;k<kMax;++k){z=z*z+c;if(cnorm(z)>ER2)break;}// fabs(z.x)*0.1 < fabs(z.y) img[j*w+i]=(k<kMax&&fabs(creal(z))*0.1<fabs(cimag(z)))?255:0;}}printf("P5\n%d %d\n255\n",w,h);fwrite(img,w*h,1,stdout);free(img);return0;}
Podpisy
Dodaj jednolinijkowe objaśnienie tego, co ten plik pokazuje