Exemplo n.º 1
0
 def __init__(self):
     self.turtle = turtle.Turtle()
     self.screen = self.turtle.getscreen()
     self.widhalf = 400
     self.heihalf = 400
     self.bound = [-2, -2, 2, 2]
     self.center = [0,0]
     self.turtle.hideturtle()
     self.screen.tracer(2000,0)
     self.turtle.pensize(1)
     self.screen.screensize(400, 400)
     for i in range(-self.widhalf,self.widhalf):
         self.turtle.pu()
         self.turtle.goto(i,-self.heihalf)
         self.turtle.pd()
         for j in range(-self.heihalf,self.heihalf):
             c = Complex(i*2/self.widhalf, j*2/self.heihalf)
             M = Mandelbrot(c,50)
             color = M.get_color()
             self.turtle.pencolor(color)
             self.turtle.goto(i,j)
     self.screen.onclick(self.click)
     self.screen.listen()
     self.screen.mainloop() 
     print("here");
Exemplo n.º 2
0
 def draw(self):
     self.execute = False
     for i in range(-150, 150):
         for j in range(-150, 150):
             complexnum = Complex(self.cx + self.maxcp / self.maxtp * i,
                                  self.cy + self.maxcp / self.maxtp * j)
             mandelbrot = Mandelbrot(complexnum)
             self.t.penup()
             self.t.goto(i, j)
             self.t.pendown()
             self.t.pencolor(mandelbrot.get_color())
             self.t.forward(1)
     self.execute = True
Exemplo n.º 3
0
 def draw(self):
     self.turtle.clear()
     for i in range(-self.widhalf,self.widhalf):
         self.turtle.pu()
         self.turtle.goto(i,-self.heihalf)
         self.turtle.pd()
         for j in range(-self.heihalf,self.heihalf):
             mwidhalf = (self.bound[2] - self.bound[0])/2
             mheihalf = (self.bound[3] - self.bound[1])/2
             a = i*mwidhalf/self.widhalf + self.center[0]
             b = j*mheihalf/self.heihalf + self.center[1]
             c = Complex(a, b)
             M = Mandelbrot(c,50)
             color = M.get_color()
             self.turtle.pencolor(color)
             self.turtle.goto(i,j)