Loading [MathJax]/extensions/tex2jax.js
ROOT
Version v6.22
master
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
v6.04
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
►
File List
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"Example with Formula"
,200,10,700,500);
13
//
14
// We create a formula object and compute the value of this formula
15
// for two different values of the x variable.
16
//
17
auto
form1 =
new
TFormula
(
"form1"
,
"sqrt(abs(x))"
);
18
form1->Eval(2);
19
form1->Eval(-45);
20
//
21
// Create a one dimensional function and draw it
22
//
23
auto
fun1 =
new
TF1
(
"fun1"
,
"abs(sin(x)/x)"
,0,10);
24
c1
->SetGridx();
25
c1
->SetGridy();
26
fun1->Draw();
27
c1
->Update();
28
//
29
// Before leaving this demo, we print the list of objects known to ROOT
30
//
31
if
(
gObjectTable
)
gObjectTable
->
Print
();
32
}
gObjectTable
R__EXTERN TObjectTable * gObjectTable
Definition:
TObjectTable.h:82
TCanvas
The Canvas class.
Definition:
TCanvas.h:27
TF1
1-Dim function class
Definition:
TF1.h:210
TFormula
The Formula class.
Definition:
TFormula.h:84
TObjectTable::Print
void Print(Option_t *option="") const
Print the object table.
Definition:
TObjectTable.cxx:119
c1
return c1
Definition:
legend1.C:41
formula1
Definition:
formula1.py:1
tutorials
graphics
formula1.C
ROOT v6-22 - Reference Guide Generated on Fri Apr 1 2022 11:53:26 (GVA Time) using Doxygen 1.9.4