35 void mygenerate(
double factor,
double cen_x,
double cen_y)
37 printf(
"Regenerating...\n");
55 if(last_histo!=
NULL)
delete last_histo;
57 last_histo=
new TH2F(
"h2",
58 "Mandelbrot [move mouse and press z to zoom, u to unzoom, r to reset]",
62 const int max_iter=50;
63 for(
int bx=1;bx<=last_histo->
GetNbinsX();bx++)
64 for(
int by=1;by<=last_histo->
GetNbinsY();by++)
73 last_histo->
Fill(x,y);
75 if(iter>max_iter)
break;
79 last_histo->
Draw(
"colz");
88 int event =
gPad->GetEvent();
89 int px =
gPad->GetEventX();
90 int py =
gPad->GetEventY();
93 double xd =
gPad->AbsPixeltoX(px);
94 double yd =
gPad->AbsPixeltoY(py);
95 float x =
gPad->PadtoX(xd);
96 float y =
gPad->PadtoY(yd);
111 mygenerate(1./Z, last_x, last_y);
114 mygenerate(Z , last_x, last_y);
117 mygenerate(-1 , last_x, last_y);
127 new TCanvas(
"canvas",
"View Mandelbrot set");
132 gPad->AddExec(
"myexec",
"myexec()");
void SetPadGridX(Bool_t gridx)
virtual void SetContour(Int_t nlevels, const Double_t *levels=0)
Set the number and values of contour levels.
R__EXTERN TStyle * gStyle
virtual void SetBins(Int_t nx, Double_t xmin, Double_t xmax)
Redefine x axis parameters.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual void Reset(Option_t *option="")
Reset this histogram: contents, errors, etc.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
tomato 2-D histogram with a float per channel (see TH1 documentation)}
you should not use this method at all Int_t Int_t z
virtual Int_t GetNbinsX() const
Int_t Fill(Double_t)
Invalid Fill method.
void SetPadGridY(Bool_t gridy)
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
virtual Int_t GetNbinsY() const