Last change
on this file since 7293 was
6991,
checked in by rwilson, 16 years ago
|
Initial commit of the cluster acceptance package.
|
-
Property svn:executable set to
*
|
File size:
706 bytes
|
Rev | Line | |
---|
[6991] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
| 3 | """Sequential program computing the Mandelbrot set. |
---|
| 4 | |
---|
| 5 | Ole Nielsen, SUT 2003 |
---|
| 6 | """ |
---|
| 7 | |
---|
| 8 | from mandelbrot import calculate_region |
---|
| 9 | from mandelplot import plot |
---|
| 10 | import time |
---|
| 11 | |
---|
| 12 | # User definable parameters |
---|
| 13 | kmax = 2**15 # Maximal number of iterations (=number of colors) |
---|
| 14 | M = N = 700 # width = height = N (200, 400, 600, 700 are good) |
---|
| 15 | #M = N = 400 # width = height = N (200, 400, 600, 700 are good) |
---|
| 16 | |
---|
| 17 | # Region in complex plane |
---|
| 18 | real_min = -2.0 |
---|
| 19 | real_max = 1.0 |
---|
| 20 | imag_min = -1.5 |
---|
| 21 | imag_max = 1.5 |
---|
| 22 | |
---|
| 23 | # Compute Mandelbrot set |
---|
| 24 | t0 = time.time() |
---|
| 25 | A = calculate_region(real_min, real_max, imag_min, imag_max, kmax, M, N) |
---|
| 26 | print 'Computed region in %.2f seconds' %(time.time()-t0) |
---|
| 27 | |
---|
| 28 | # Plot result |
---|
| 29 | plot(A, kmax) |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | |
---|
Note: See
TracBrowser
for help on using the repository browser.