/* *********************************************************************** * * * The Continuous Potential Method for the Mandelbrot Set * * * * Program by * * Christopher D. Watkins * * * * 'C' conversion by * * Larry Sharp * * * *********************************************************************** */ #include "stdio.h" #include "dos.h" #include "conio.h" #include "math.h" #include "string.h" #include "math.inc" #include "graph.inc" #include "render.inc" /* 125 iterations maximum */ #define XMin -2.50 #define XMax 1.35 #define YMin -1.80 #define YMax 1.80 #define Iter 32 #define Scal 32767 char ObjF[]="CPM1"; /* #define XMin -0.19 #define XMax -0.13 #define YMin 1.01 #define YMax 1.06 #define Iter 125 #define Scal 3276700 char ObjF[]="CPM2"; */ float MSetPot(float cx, float cy, int MaxIter, int *Iters) { float x, y; float x2, y2; float temp; x=cx; x2=SqrFP(x); y=cy; y2=SqrFP(y); *Iters=0; while((*ItersMax) Max=Height[i][j]; } } for(i=0; i<=MaxRes; i++) { for(j=0; j<=MaxRes; j++) { Height[i][j]=Max-Height[i][j]; } } } /* *********************************************************************** * * * Main Program * * * *********************************************************************** */ void main() { clrscr(); Scaling=32767; Res=MaxRes; InitGraphics(); ClearHeightBuffer(); MSetCPM(Res, Res, Iter, XMin, XMax, YMin, YMax); InverseHeightBuffer(); strcpy(ObjectFile, ObjF); SaveHeightBuffer(ObjectFile); ExitGraphics(); }