# This text file describes bitmap :C:\Documents and Settings\adam\Pulpit\b2_error.bmp it should be arg(phi) where phi = Boettcher coordinate but is not added boundary of Mandelbrot set by DEM/M # # # This bitmap shows Mandelbrot Set for function F(z)=z*z+c # # # Bitmap details: #------------------------------------------------------------ MainAlgorithmType:=maPhi #----------------------------------------------------------- # The image contains a rectangular region : #---------- corners of c-plane --------------- C_Plane.eCxMin:= -1,83333333333333 C_Plane.eCxMax:= -0,5 C_Plane.eCyMin:= -0,360902255639098 C_Plane.eCyMax:= 0,972431077694236 #--------- center and sides of c-plane ----------- C_Plane.Center.x:= -0,5 C_Plane.Center.y:= 0 C_Plane.width:= 1,33333333333333 C_Plane.height:= 1,33333333333333 #--------------------------------- # Bitmap size in pixels: Bitmap Width= 400 Bitmap Height= 400 Number of bitmap points = 160000 points Drawing Time := 391 miliseconds # # Bitmapa.PixelFormat = pf32bit #------------------------------------ # If Distorsion = 1 then image is not deformed integer Width / Height Ratio =1 extended Width / Height Ratio =1 eWHR/iWHR = Distorsion=1 #---------------------------------------------------- # Maximal number of iterations IterationMax :integer:= 1000 Escape Radius :single:= 100 #------------------------- # # Informations about program: program name: MandelbrotSetExplorer # It is made using: # programing language: object Pascal # compiler : VER 140- # IDE: Borland Delphi 6.0 - 7.0 personal edition - 10.0 Turbo Explorer # programing style : obiektowy # method : wizualna (RAD) # libaries : standard = VCL # OS: windows 98 SE # hardware: PC: AMD Duron 600 # # author: Adam Majewski # adammaj1@o2.pl # republika.pl/fraktal # wa³brzych 27.06.20003- 2007 -------------------------------------- and here is delphi unit : ------------------------------------------------------------ unit BoettcherU; interface uses ComplexU, Math, // RadToDeg graphics, // clBlack windows; // GetBValue Procedure GivePhi_M(c:TComplexNumber; iMax:integer; var b:TComplexNumber); //----- color Procedure GiveBoettcherTerm_M(c,Zn:TComplexNumber; i:integer; var term:TComplexNumber); //----- color Procedure DrawPhi_M; //********************************************************* implementation //****************************************** //********************************************************* uses BitmapU, MappingU, AlgorithmU, ColorU; //-------------------------------- Procedure GiveBoettcherTerm_M (c,Zn:TComplexNumber; i:integer;var term:TComplexNumber); var iExponent:integer; temp,temp1:TComplexNumber; n:integer; eTemp:extended; begin // compute 2^i //iExponent:=2; //for n:=2 to i do iExponent:=2*iExponent; // CmplxSqr(Zn.x,Zn.y,temp.x,temp.y); CmplxDiv(c.x,c.y,temp.x,temp.y,temp1.x,temp1.y); // temp1.x:=1-temp1.x; temp1.y:=-temp1.y; // for n:=1 to i do begin CmplxSqr(temp1.x,temp1.y,temp.x,temp.y); temp1:=temp; if (temp.x>1000000000) or (temp.y>1000000000) then exit; end; // eTemp:=sqrt(sqrt(sqr(temp1.x)+sqr(temp1.y))); // term.x:= temp1.x *eTemp; term.y:=- temp1.y * eTemp; end; //----------------------------------------------------------------------------- Procedure GivePhi_M(c:TComplexNumber; iMax:integer; var b:TComplexNumber); // Bottcher function // phi(c) = Zn ^ (0.5 ^ n) // Z(n) = Fc( Z(n-1) ) // Fc(z) = z*z + c var temp, exponent:extended; i:integer; Zn, term:TComplexNumber; begin b:=c; Zn.x:=0; Zn.y:=0; for i:= 1 to iMax do begin temp:=sqr(Zn.x) - sqr(Zn.y) + c.x; Zn.y:=2 * Zn.x * Zn.y + c.y; Zn.x:=temp; // GiveBoettcherTerm_M(c,Zn,i,term); // CmplxMultiplication(b.x,b.y,term.x,term.y,b.x,b.y); end; // for i:= end; //------------------------ Procedure DrawPhi_M; var iteration:integer; iY,iX:integer; eZx,eZy:extended; // eZ:=eZx + eZy*i eCy ,eCx:extended; // C:=eCx + eCy*i temp:extended; //Phi ePhiX,ePhiY:extended; c,b:TComplexNumber; //argument_Phi:extended; // k:integer; // color:TColor; // begin For iY :=iYmin to iYMax do begin eCy:=Convert_iY_to_eY(iY); for iX:=iXmin to iXmax do begin eCx:=Convert_iX_to_eX(iX); // // Z0 = initial point eZx:=0; eZy:=0; For iteration:=0 to iterationMax-1 do begin // Z(n+1):= Sqr(Zn) + C temp:=Sqr(eZx)-Sqr(eZy) +eCx; eZy:=2*eZx*eZy+eCy; eZx:=temp; if (Sqr(eZx)+Sqr(eZy))> bailout2 then break; end; // // drawing procedure if iteration=IterationMax then // M-set with Bitmap1.FirstLine[iY*Bitmap1.LineLength+iX] do begin B := 0; G := 0; R := 0; //A := 0; end else // exterior of M-set begin c.x:=eCx; c.y:=eCy; GivePhi_M(c,iteration,b); k:= round(RadToDeg(CmplxArgumentInRad(b.x,b.y))); color:=Rainbow(0,360,k ); with Bitmap1.FirstLine[iY*Bitmap1.LineLength+iX] do begin B := GetBValue(color); // G := GetGValue(color); R := GetRValue(color); // //A := 0; end ; end ; //else //-------------- // // end of drawing procedure ---------- end; // for iX end; //For iY end; //--------------------------- end.