21 #if defined(__CINT__) && !defined(__MAKECINT__)
44 std::cout <<
"Drawing associate Legendre Polynomials.." << std::endl;
45 TCanvas *Canvas =
new TCanvas(
"DistCanvas",
"Associate Legendre polynomials", 10, 10, 800, 500);
56 L[0]=
new TF1(
"L_0",
"ROOT::Math::assoc_legendre(1, 0,x)", -1, 1);
57 L[1]=
new TF1(
"L_1",
"ROOT::Math::assoc_legendre(1, 1,x)", -1, 1);
58 L[2]=
new TF1(
"L_2",
"ROOT::Math::assoc_legendre(2, 0,x)", -1, 1);
59 L[3]=
new TF1(
"L_3",
"ROOT::Math::assoc_legendre(2, 1,x)", -1, 1);
60 L[4]=
new TF1(
"L_4",
"ROOT::Math::assoc_legendre(2, 2,x)", -1, 1);
75 L[0]->
SetTitle(
"Associate Legendre Polynomials");
76 for (
int nu = 0; nu < 5; nu++) {
82 leg1->
AddEntry(L[0]->DrawCopy(),
" P^{1}_{0}(x)",
"l");
83 leg1->
AddEntry(L[1]->DrawCopy(
"same"),
" P^{1}_{1}(x)",
"l");
84 leg1->
AddEntry(L[2]->DrawCopy(
"same"),
" P^{2}_{0}(x)",
"l");
85 leg1->
AddEntry(L[3]->DrawCopy(
"same"),
" P^{2}_{1}(x)",
"l");
86 leg1->
AddEntry(L[4]->DrawCopy(
"same"),
" P^{2}_{2}(x)",
"l");
94 SL[0]->
SetTitle(
"Spherical Legendre Polynomials");
95 for (
int nu = 0; nu < 5; nu++) {
101 leg2->
AddEntry(SL[0]->DrawCopy(),
" P^{1}_{0}(x)",
"l");
102 leg2->
AddEntry(SL[1]->DrawCopy(
"same"),
" P^{1}_{1}(x)",
"l");
103 leg2->
AddEntry(SL[2]->DrawCopy(
"same"),
" P^{2}_{0}(x)",
"l");
104 leg2->
AddEntry(SL[3]->DrawCopy(
"same"),
" P^{2}_{1}(x)",
"l");
105 leg2->
AddEntry(SL[4]->DrawCopy(
"same"),
" P^{2}_{2}(x)",
"l");
111 std::cout <<
"Calculating integrals of Associate Legendre Polynomials on [-1, 1]" << std::endl;
113 for (
int nu = 0; nu < 5; nu++) {
114 integral[nu] = L[nu]->
Integral(-1.0, 1.0);
115 std::cout <<
"Integral [-1,1] for Associated Legendre Polynomial of Degree " << nu <<
"\t = \t" << integral[nu] << std::endl;
virtual void SetLineWidth(Width_t lwidth)
This class displays a legend box (TPaveText) containing several legend entries.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum value along Y for this function In case the function is already drawn, set also the minimum in the helper histogram.
virtual Double_t Integral(Double_t a, Double_t b, Double_t epsrel=1.e-12)
IntegralOneDim or analytical integral.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
virtual void SetLineColor(Color_t lcolor)
R__EXTERN TSystem * gSystem
virtual void SetFillColor(Color_t fcolor)
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn, set also the maximum in the helper histogram.
virtual void SetTitle(const char *title="")
Set function title if title has the form "fffffff;xxxx;yyyy", it is assumed that the function title i...
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void SetLineStyle(Style_t lstyle)
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
void SetFrameFillColor(Color_t color=1)