class Traj { double centerX; double centerY; double radius; double speed; double phi; TMarker *marker; static TRandom *rand; public: Traj(double x, double y, double r, double s, int m) { if(rand == 0) rand = new TRandom(); if(x < 0.0) x = rand->Uniform(); if(y < 0.0) y = rand->Uniform(); if(r < 0.0) r = 0.1*rand->Uniform() + 0.1; if(s < 0.0) s = 0.1*rand->Uniform(); centerX=x; centerY=y; radius=r; speed=s; phi=2.0*3.14159*rand->Uniform(); marker = new TMarker(x,y,m); marker->Draw(); } void draw() { double x=radius*cos(phi) + centerX; double y=radius*sin(phi) + centerY; marker->SetX(x); marker->SetY(y); phi += speed; if(phi > 2.0*3.14159) phi -= 2.0*3.14159; } }; TRandom *Traj::rand=0; void movie() { printf("movie.C begun\n"); #define N 25 Traj *t[N]; c = new TCanvas(); for(int i=0; idraw(); //c->Update(); char tmp[64]; sprintf(tmp,"m_%d.png",i); c->SaveAs(tmp); } delete c; printf("movie.C ends\n"); gApplication->Terminate(0); }