12 gBenchmark->Start(
"tornado");
14 double PI = 3.141592653;
16 int numberOfPoints=200;
17 int numberOfCircles=40;
20 TCanvas *sky =
new TCanvas(
"sky",
"Tornado", 300, 10, 700, 500 );
21 sky->SetFillColor(14);
24 TView *view = TView::CreateView(1,0,0);
25 float range = numberOfCircles*d;
26 view->SetRange( 0, 0, 0, 4.0*range, 2.0*range, range );
28 for(
int j = d; j < numberOfCircles*d; j += d ) {
31 TPolyMarker3D *pm3d =
new TPolyMarker3D( numberOfPoints );
36 for(
int i = 1; i < numberOfPoints; i++ ) {
37 float csin = sin(2*PI / (
double)numberOfPoints * (
double)i) + 1;
38 float ccos = cos(2*PI / (
double)numberOfPoints * (
double)i) + 1;
39 float esin = sin(2*PI / (
double)(numberOfCircles*d) * (
double)j) + 1;
40 x = j * ( csin + esin );
43 pm3d->SetPoint( i, x, y, z );
47 pm3d->SetMarkerSize( 1 );
48 pm3d->SetMarkerColor( 2 + ( d == ( j & d ) ) );
49 pm3d->SetMarkerStyle( 3 );
56 gBenchmark->Show(
"tornado");
58 Float_t ct = gBenchmark->GetCpuTime(
"tornado");
59 sprintf( timeStr,
"Execution time: %g sec.", ct);
61 TPaveText *text =
new TPaveText( 0.1, 0.81, 0.9, 0.97 );
62 text->SetFillColor( 42 );
63 text->AddText(
"ROOT example: tornado.C");
64 text->AddText(timeStr);