ROOT
master
Reference Guide
Loading...
Searching...
No Matches
formula1.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// \notebook -js
4
/// Display interpreted functions.
5
///
6
/// \macro_image
7
/// \macro_code
8
///
9
/// \author Rene Brun
10
11
void
formula1
()
12
{
13
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"Example with Formula"
, 200, 10, 700, 500);
14
//
15
// We create a formula object and compute the value of this formula
16
// for two different values of the x variable.
17
//
18
auto
form1 =
new
TFormula
(
"form1"
,
"sqrt(abs(x))"
);
19
form1->Eval(2);
20
form1->Eval(-45);
21
//
22
// Create a one dimensional function and draw it
23
//
24
auto
fun1 =
new
TF1
(
"fun1"
,
"abs(sin(x)/x)"
, 0, 10);
25
c1
->SetGridx();
26
c1
->SetGridy();
27
fun1->Draw();
28
c1
->Update();
29
//
30
// Before leaving this demo, we print the list of objects known to ROOT
31
//
32
if
(
gObjectTable
)
33
gObjectTable
->
Print
();
34
}
gObjectTable
R__EXTERN TObjectTable * gObjectTable
Definition
TObjectTable.h:82
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TF1
1-Dim function class
Definition
TF1.h:233
TFormula
The Formula class.
Definition
TFormula.h:89
TObjectTable::Print
void Print(Option_t *option="") const override
Print the object table.
Definition
TObjectTable.cxx:120
c1
return c1
Definition
legend1.C:41
formula1
Definition
formula1.py:1
tutorials
visualisation
graphics
formula1.C
ROOT master - Reference Guide Generated on Thu Dec 19 2024 09:47:24 (GVA Time) using Doxygen 1.9.8