Talk:Mandelbrot set: Difference between revisions

Content added Content deleted
Line 9: Line 9:
: The simplest way to draw the set (and the only one which would fulfill a strict definition of "drawing the set") would only use two colors: One color for the points in the set (usually, black is used for those points), and another for points outside the set (the natural choice would be white). Of course, what you can draw is only an approximation of the set (because you only do a finite number of iterations; to actually decide if a point is in the Mandelbrot set you'd need an infinite number of iterations, which isn't possible, of course).
: The simplest way to draw the set (and the only one which would fulfill a strict definition of "drawing the set") would only use two colors: One color for the points in the set (usually, black is used for those points), and another for points outside the set (the natural choice would be white). Of course, what you can draw is only an approximation of the set (because you only do a finite number of iterations; to actually decide if a point is in the Mandelbrot set you'd need an infinite number of iterations, which isn't possible, of course).
: However, the algorithm gives you some more information: It not only tells you whether the point ever left the circle, but it also tells you <em>when</em> it left the circle. And since colored pictures look more interesting than black/white ones, usually that information is used to color the image. --[[User:Ce|Ce]] 21:02, 14 August 2010 (UTC)
: However, the algorithm gives you some more information: It not only tells you whether the point ever left the circle, but it also tells you <em>when</em> it left the circle. And since colored pictures look more interesting than black/white ones, usually that information is used to color the image. --[[User:Ce|Ce]] 21:02, 14 August 2010 (UTC)

== More complex version of JavaScript code ==

I've improved the JavaScript code to provide several choices of coloring (standard [the one I've already put on RosettaCode], smooth, relief and none [i.e.just the black set on white background]), a possibility to keep the aspect ratio (i.e. if you give a rectangle which doesn't have the same aspect ratio as the canvas, one dimension is extended to give the correct aspect ratio again), and tests for the main cardioid and the first bulb to improve calculation speed. However that complicates the code (e.g. due to the relief code, I have to go through the image in diagonals). Now I see several possibilities:
* Just leave the page as it is and don't put the advanced code here (maybe put it online elsewhere).
* Replace the current code with the new one.
* Add the new code after the current one.
* Make a new page for the additional implementation, put the extended code there, and link to that page after the existing code.
* Make a new page, and put both the existing code and the new version there.
Which option do you think I should choose? --[[User:Ce|Ce]] 08:15, 22 August 2010 (UTC)