ROOT logo

From $ROOTSYS/tutorials/graphics/formula1.C

//Display interpreted functions
//Author: Rene Brun
void formula1() {
   //
   // To see the graphics output of this macro, click begin_html <a href="gif/formula1.gif">here</a>. end_html
   //
   TCanvas *c1 = new TCanvas("c1","Example with Formula",200,10,700,500);
   //
   // We create a formula object and compute the value of this formula
   // for two different values of the x variable.
   //
   form1 = new TFormula("form1","sqrt(abs(x))");
   form1->Eval(2);
   form1->Eval(-45);
   //
   // Create a one dimensional function and draw it
   //
   fun1 = new TF1("fun1","abs(sin(x)/x)",0,10);
   c1->SetGridx();
   c1->SetGridy();
   fun1->Draw();
   c1->Update();
   //
   // Before leaving this demo, we print the list of objects known to ROOT
   //
   if (gObjectTable) gObjectTable->Print();
}
 formula1.C:1
 formula1.C:2
 formula1.C:3
 formula1.C:4
 formula1.C:5
 formula1.C:6
 formula1.C:7
 formula1.C:8
 formula1.C:9
 formula1.C:10
 formula1.C:11
 formula1.C:12
 formula1.C:13
 formula1.C:14
 formula1.C:15
 formula1.C:16
 formula1.C:17
 formula1.C:18
 formula1.C:19
 formula1.C:20
 formula1.C:21
 formula1.C:22
 formula1.C:23
 formula1.C:24
 formula1.C:25
 formula1.C:26
 formula1.C:27
 formula1.C:28
thumb