def render(self): Fractal.render(self) if not self.samples: self.set_samples(int(0.5 * self.w * self.h)) for _ in xrange(self.samples): c = self.sample_point() n, path = self.in_mandelbrot(c) if n > self.min_path: self.draw_trajectory(path)
def render(self): """ Renders the mandelbrot set on pixel_mat >>> m = Mandelbrot() >>> m.render() """ Fractal.render(self) lutx = [ j * (self.rb[1] - self.rb[0]) / (self.w - 1) + self.rb[0] for j in xrange(self.w) ] for y in xrange(self.h): cy = y * (self.ib[1] - self.ib[0]) / (self.h - 1) + self.ib[0] for x in xrange(self.w): c = complex(lutx[x], cy) iters = self.in_mandelbrot(0, c) if iters > 0: self.set_point(x, y, iters)