//Display interpreted functions
//Author: Rene Brun
void formula1() {
   //
   // To see the graphics output of this macro, click 
here.

   //
   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();
}
thumb

Last change: Wed Dec 17 10:52:32 2008
Last generated: 2008-12-17 10:52

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.