/* ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º º º 3 º º cnewton = MAP OF NEWTON'S METHOD FOR SOLVING Z -2z - 5 = 0 º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ */ #include #include #include #include #include "tools.h" const int maxcol = 639; const int maxrow = 349; const int max_colors = 16; char strings[80]; int col,row,i; int max_iterations = 64; int max_size = 4; int LINEWIDTH=1, OPERATOR=0, ANGLE, XCENTER, YCENTER; int CURSOR_X=0,CURSOR_Y=0; unsigned long int PATTERN=0xFFFFFFFF; /*float P=-.5,Q=0,Xmax= 1.5, Xmin=-1.5, Ymax=1.20, Ymin=-1.20;*/ float Xmax = 3.5, Xmin=-3.5, Ymax=2.50, Ymin=-2.50; char *args[] = {"ZS.EXE", "SCREEN59", "/r",NULL}; char *pathname = {"C:\\TURBOC\\ZS.EXE"}; main() { double deltaX, deltaY, X, Y, Xsquare, Ysquare,Ytemp,temp1,temp2,temp3,denom,numer,theta; int color, row, col; float Xold,Yold,Xnew,Ynew; setMode(16); cls(7); deltaX = (Xmax - Xmin)/(maxcol); deltaY = (Ymax - Ymin)/(maxrow); for (col=0; col<=maxcol; col++) { if (kbhit() != 0) break; for (row=0; row<=maxrow; row++) { X = Xmin + col * deltaX; Y = Ymax - row * deltaY; Xsquare = 0; Ysquare = 0; Xold = 42; Yold = 42; for (i=0; i0) color = i%5; else { if ((X<-.3) && (Y>0)) color = (i%5) + 5; else color = (i%6) + 10; } plot(col, row, color); } } getch(); }