File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #!/usr/bin/env python
1+ import matplotlib .pyplot as plt
2+ import numpy as np
23
3- from pylab import *
4-
5- theta = arange (0 , 8 * pi , 0.1 )
4+ theta = np .arange (0 , 8 * np .pi , 0.1 )
65a = 1
76b = .2
87
9- for dt in arange (0 , 2 * pi , pi / 2.0 ):
8+ for dt in np . arange (0 , 2 * np . pi , np . pi / 2.0 ):
109
11- x = a * cos (theta + dt )* exp (b * theta )
12- y = a * sin (theta + dt )* exp (b * theta )
10+ x = a * np . cos (theta + dt )* np . exp (b * theta )
11+ y = a * np . sin (theta + dt )* np . exp (b * theta )
1312
14- dt = dt + pi / 4.0
13+ dt = dt + np . pi / 4.0
1514
16- x2 = a * cos (theta + dt )* exp (b * theta )
17- y2 = a * sin (theta + dt )* exp (b * theta )
15+ x2 = a * np . cos (theta + dt )* np . exp (b * theta )
16+ y2 = a * np . sin (theta + dt )* np . exp (b * theta )
1817
19- xf = concatenate ((x , x2 [::- 1 ]))
20- yf = concatenate ((y , y2 [::- 1 ]))
18+ xf = np . concatenate ((x , x2 [::- 1 ]))
19+ yf = np . concatenate ((y , y2 [::- 1 ]))
2120
22- p1 = fill (xf , yf )
21+ p1 = plt . fill (xf , yf )
2322
24- show ()
23+ plt . show ()
You can’t perform that action at this time.
0 commit comments