https://github.com/root-project/root
Raw File
Tip revision: 7fe8dc9e32f7575c74bb1e5f5e3f90fefed2975b authored by Unknown Author on 06 May 2002, 16:15:10 UTC
This commit was manufactured by cvs2svn to create tag 'v3-03-05'.
Tip revision: 7fe8dc9
formula1.C
{
   //
   // To see the graphics output of this macro, click begin_html <a href="gif/formula1.gif">here</a>. end_html
   //
   gROOT->Reset();
   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();
}
back to top