Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
mathcoreSpecFunc.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Example macro showcasing some special mathematical functions.

To execute the macro type in:

It will create a canvas with the representation of the tgamma, lgamma, erf and erfc functions.

f␕

#include "TF1.h"
#include "TSystem.h"
#include "TCanvas.h"
TF1 *f1a = new TF1("f1a","ROOT::Math::tgamma(x)",0,20);
TF1 *f2a = new TF1("f2a","ROOT::Math::lgamma(x)",0,100);
TF1 *f3a = new TF1("f3a","ROOT::Math::erf(x)",0,5);
TF1 *f4a = new TF1("f4a","ROOT::Math::erfc(x)",0,5);
TCanvas *c1 = new TCanvas("c1","c1",800,600);
f1a->SetLineColor(kBlue);
f1b->SetLineColor(kBlue);
f2a->SetLineColor(kBlue);
f2b->SetLineColor(kBlue);
f3a->SetLineColor(kBlue);
f3b->SetLineColor(kBlue);
f4a->SetLineColor(kBlue);
f4b->SetLineColor(kBlue);
c1->Divide(2,2);
c1->cd(1);
f1a->Draw();
c1->cd(2);
f2a->Draw();
c1->cd(3);
f3a->Draw();
c1->cd(4);
f4a->Draw();
}
@ kBlue
Definition Rtypes.h:66
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
1-Dim function class
Definition TF1.h:234
return c1
Definition legend1.C:41
Author
Andras Zsenei

Definition in file mathcoreSpecFunc.C.