#include "TF2.h" #include "TF12.h" #include "TCanvas.h" #include "TF1.h" TF2 *f = new TF2("f", "[0]*[0]*(x^2+y^2)+[1]*(x^2+y^2)", -1, 1, -1, 1); Double_t intg(Double_t *x, Double_t *par) { f->SetParameters(x[0], x[1]); return f->Integral(-1, 1, -1, 1); } void par() { f->SetNpx(100); f->SetNpy(100); f->SetParameters(2, 1); f->Draw("colz"); new TCanvas(); TF2 *ires = new TF2("ires", intg, -1, 1, -1, 1, 0); ires->SetNpx(100); ires->SetNpy(100); ires->Draw("colz"); }