Example of first few Legendre Polynomials.
Inspired by work of Lorenzo Moneta.
5 ROOT.gSystem.Load(
"libMathMore")
6 Canvas = ROOT.TCanvas(
"DistCanvas",
"Legendre polynomials example", 10, 10, 750, 600)
8 leg = ROOT.TLegend(0.5, 0.7, 0.4, 0.89)
12 f = ROOT.TF1(
"L_0",
"ROOT::Math::legendre([0],x)", -1, 1)
13 f.SetParameters(nu, 0.0)
21 L[0].SetTitle(
"Legendre polynomials")
22 leg.AddEntry(L[0].
Draw(),
" L_{0}(x)",
"l")
23 leg.AddEntry(L[1].
Draw(
"same"),
" L_{1}(x)",
"l")
24 leg.AddEntry(L[2].
Draw(
"same"),
" L_{2}(x)",
"l")
25 leg.AddEntry(L[3].
Draw(
"same"),
" L_{3}(x)",
"l")
26 leg.AddEntry(L[4].
Draw(
"same"),
" L_{4}(x)",
"l")
- Author
- Alberto Ferro
Definition in file Legendre.py.