00001 //Display interpreted functions 00002 //Author: Rene Brun 00003 void formula1() { 00004 // 00005 // To see the graphics output of this macro, click begin_html <a href="gif/formula1.gif">here</a>. end_html 00006 // 00007 TCanvas *c1 = new TCanvas("c1","Example with Formula",200,10,700,500); 00008 // 00009 // We create a formula object and compute the value of this formula 00010 // for two different values of the x variable. 00011 // 00012 form1 = new TFormula("form1","sqrt(abs(x))"); 00013 form1->Eval(2); 00014 form1->Eval(-45); 00015 // 00016 // Create a one dimensional function and draw it 00017 // 00018 fun1 = new TF1("fun1","abs(sin(x)/x)",0,10); 00019 c1->SetGridx(); 00020 c1->SetGridy(); 00021 fun1->Draw(); 00022 c1->Update(); 00023 // 00024 // Before leaving this demo, we print the list of objects known to ROOT 00025 // 00026 if (gObjectTable) gObjectTable->Print(); 00027 }