int width = 700; int height = 700; int maxtries = 100; float xlow = -2; float xhigh = 2; float ylow = -2; float yhigh = 2; void test() { TCanvas *c = new TCanvas("c","c",width,height); float currX = xlow; float currY = ylow; for (int xpix=0;xpix<=width;xpix++) { for (int ypix=0;ypix<=height;ypix++) { currX = xlow + (xhigh-xlow) * float(xpix)/float(width); currY = ylow + (yhigh-ylow) * float(ypix)/float(height); float zx = 0; float zy = 0; bool escapes = false; for (int i=0;i 2) { TEllipse *e = new TEllipse(float(xpix)/float(width), float(ypix)/float(height), 0.5/width, 0.5/height); e->SetLineColor(0); e->SetFillColor(0); e->Draw(); escapes = true; break; } } if (!escapes) { TEllipse *e = new TEllipse(float(xpix)/float(width), float(ypix)/float(height), 0.5/width, 0.5/height); e->SetLineColor(kBlack); e->SetFillColor(kBlack); e->Draw(); } } } c->SaveAs("mandelbrot.png"); }