Macro illustrating how to animate a picture using a Timer.
void anim()
{
f2 =
new TF2(
"f2",
"sin(2*x)*sin(2*y)*[0]",0,pi,0,pi);
}
void Animate()
{
if (!
gROOT->GetListOfCanvases()->FindObject(
"c1"))
return;
t += 0.05*pi;
phi += 2;
}
R__EXTERN TStyle * gStyle
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn,...
virtual void SetNpx(Int_t npx=100)
Set the number of points used to draw the function.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum value along Y for this function In case the function is already drawn,...
virtual void SetParameter(Int_t param, Double_t value)
A 2-Dim function with parameters.
virtual void SetNpy(Int_t npy=100)
Set the number of points used to draw the function.
void Draw(Option_t *option="") override
Draw this function with its current attributes.
void SetFrameFillColor(Color_t color=1)
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Handles synchronous and a-synchronous timer events.
virtual void TurnOn()
Add the timer to the system timer list.
void SetCommand(const char *command)
Set the interpreter command to be executed at time out.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
- Author
- Rene Brun
Definition in file anim.C.