11 from ROOT
import TCanvas, TView, TPolyMarker3D, TPaveText
12 from ROOT
import gROOT, gBenchmark
13 from math
import cos, sin, pi
15 gBenchmark.Start(
'tornado' )
22 sky =
TCanvas(
'sky',
'Tornado', 300, 10, 700, 500 )
23 sky.SetFillColor( 14 )
27 rng = numberOfCircles * d
28 view.SetRange( 0, 0, 0, 4.0*rng, 2.0*rng, rng )
31 for j
in range( d, numberOfCircles * d, d ):
37 for i
in range( 1, numberOfPoints ) :
38 csin =
sin( 2*pi / numberOfPoints * i ) + 1
39 ccos =
cos( 2*pi / numberOfPoints * i ) + 1
40 esin =
sin( 2*pi / (numberOfCircles*d) * j ) + 1
41 x = j * ( csin + esin );
44 pm3d.SetPoint( i, x, y, z );
47 pm3d.SetMarkerSize( 1 )
48 pm3d.SetMarkerColor( 2 + ( d == ( j & d ) ) )
49 pm3d.SetMarkerStyle( 3 )
55 polymarkers.append( pm3d )
57 gBenchmark.Show(
'tornado' )
59 ct = gBenchmark.GetCpuTime(
'tornado' )
60 timeStr =
'Execution time: %g sec.' % ct
63 text.SetFillColor( 42 )
64 text.AddText(
'PyROOT example: tornado.py' )
65 text.AddText( timeStr )
A Pave (see TPave) with text, lines or/and boxes inside.
static TView * CreateView(Int_t system=1, const Double_t *rmin=0, const Double_t *rmax=0)
Create a concrete default 3-d view via the plug-in manager.