2.2.4 函数与图形
基本函数表达
root中的函数表达和C语言重合,例如:
sin(x)/x
[0]*sin(x) + [1]*exp(-[2]*x)
x + y**2
x^2 + y^2
[0]*pow([1],4)
2*pi*sqrt(x/y)
gaus(0)*expo(3) + ypol3(5)*x
gausn(0)*expo(3) + ypol3(5)*x
gaus(x, [0..2]) + expo(y, [3..4])
In the last examples above:
gaus(0)
is a substitute for[0]*exp(-0.5*((x-[1])/[2])**2)
and (0) means start numbering parameters at 0gausn(0)
is a substitute for[0]*exp(-0.5*((x-[1])/[2])**2)/(sqrt(2*pi)*[2]))
and (0) means start numbering parameters at 0expo(3)
is a substitute forexp([3]+[4]*x)
pol3(5)
is a substitute forpar[5]+par[6]*x+par[7]*x**2+par[8]*x**3
(PolN
stands for Polynomial of degree N)gaus(x, [0..2])
is a more explicit way of writinggaus(0)
expo(y, [3..4])
is a substitute forexp([3]+[4]*y)
See below the full list of predefined functions which can be used as shortcuts in TFormula.
TMath
作为表达式的一部分:
TMath::Landau(x)*sin(x)
TMath::Erf(x)
Formula may contain constants, eg:
sqrt2
e
pi
ln10
infinity
and more.
直线
箭头
https://root.cern/doc/master/classTArrow.html
ar4->SetAngle(60);
默认箭头
矩形 TBox
矩形文本框 TPaveLabel
椭圆 TEllipse
TEllipse是很强大的类,它能帮你绘制椭圆、圆、半圆、倾斜的椭圆等,其标准用如下:
蜂巢图
多边形
地图
最后更新于