@@ -33,11 +33,11 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
3333 from matplotlib import colors
3434 import matplotlib .pyplot as plt
3535
36- xmin , xmax , xn = - 2.25 , + 0.75 , 3000 / 2
37- ymin , ymax , yn = - 1.25 , + 1.25 , 2500 / 2
36+ xmin , xmax , xn = - 2.25 , + 0.75 , 3000 // 2
37+ ymin , ymax , yn = - 1.25 , + 1.25 , 2500 // 2
3838 maxiter = 200
3939 horizon = 2.0 ** 40
40- log_horizon = np .log (np .log (horizon )) / np . log ( 2 )
40+ log_horizon = np .log2 (np .log (horizon ))
4141 Z , N = mandelbrot_set (xmin , xmax , ymin , ymax , xn , yn , maxiter , horizon )
4242
4343 # Normalized recount as explained in:
@@ -47,15 +47,13 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
4747 # This line will generate warnings for null values but it is faster to
4848 # process them afterwards using the nan_to_num
4949 with np .errstate (invalid = 'ignore' ):
50- M = np .nan_to_num (N + 1 -
51- np .log (np .log (abs (Z )))/ np .log (2 ) +
52- log_horizon )
50+ M = np .nan_to_num (N + 1 - np .log2 (np .log (abs (Z ))) + log_horizon )
5351
5452 dpi = 72
5553 width = 10
5654 height = 10 * yn / xn
5755 fig = plt .figure (figsize = (width , height ), dpi = dpi )
58- ax = fig .add_axes ([0.0 , 0.0 , 1.0 , 1.0 ], frameon = False , aspect = 1 )
56+ ax = fig .add_axes ([0 , 0 , 1 , 1 ], frameon = False , aspect = 1 )
5957
6058 # Shaded rendering
6159 light = colors .LightSource (azdeg = 315 , altdeg = 10 )
0 commit comments