• Post Reply Bookmark Topic Watch Topic
  • New Topic

draw a circle instead of Mandelbrot set  RSS feed

 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please help to spot my stupid mistake please!
Here is the code of method where the problem comes from:

It should draw a Mandelbrot set but it draws just a circle can anyone help me please! why it draws the circle ?=/

Here is a formulae that I used
Z(0), Z(1), Z(2), Z(3), ... where Z(i+1) = (Z(i) * Z(i)) + c and Z(0) = c
c- complex number=/
 
Paul Clapham
Sheriff
Posts: 22829
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shouldn't the "temp" value be a constant? You've made your Complex class mutable (a questionable choice) so every time you change the "c" value you also change "temp", because they both refer to the same object.
 
Bobby Marvikuan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Shouldn't the "temp" value be a constant? You've made your Complex class mutable (a questionable choice) so every time you change the "c" value you also change "temp", because they both refer to the same object.

Thanks a lot actually because of this problem my code did wrong staff=/ Thank you!:)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!