I think we could use a better description here. I'm no mathemetician, but it looks like most of the Mandlebrot images we see (including most of the code attached to this task page) are stackings of the point sets each iteration. (Makes me wish I had a voxel view) Does that sound correct? --Michael Mol 20:19, 14 August 2010 (UTC)
- I don't understand your description, but what usually determines the color is the number of iterations until the point leaves the circle of radius 2 (one can prove that if it ever leaves that circle, it ultimately goes to infinity; of course the reverse holds, too).
- 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 when it left the circle. And since colored pictures look more interesting than black/white ones, usually that information is used to color the image. --Ce 21:02, 14 August 2010 (UTC)
- 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.
making C version work
What assumptions need to be filled to make the C version work?
I tried building it under cygwin, with the glut runtime and dev installed, using
<lang bash>CFLAGS='-L/usr/lib/w32api -lgl -lGLU32 -lopengl32 -lglut -lm' make mandelbrot</lang>
And that failed for me with lots of failures to link to various entry points which seem to be defined in /usr/lib/libglut.a
- Does the linker fail to find libglut or does it fail to find function that libglut calls? On my system the program needs libGL.so, libGLU.so, libglut.so and libm.a, all of which should be portable. Can you ldd those? --Ledrug 21:11, 28 July 2011 (UTC)
- Try putting your flags in the correct order. The -l flags must be after the .c file, and libraries must go in order with -lglut before its dependencies. (ELF shared libraries might already know about their dependencies, but other kinds of libraries might not.) Try this:
- <lang bash>make mandelbrot LDLIBS='-L/usr/lib/w32api -lglut -lGLU32 -lopengl32 -lgl -lm'</lang>
Task description !!!!
Hi. Some programs make ASCII image on the screen, some make colur image to bmp, some to ppm file. I think that it makes comparisen very difficult ( ? impossible ). Regards --Adam majewski 07:47, 26 November 2011 (UTC)
Hi. Haskell version works, but what means "\" in line
mandelbrot a = iterate (\z -> z^2 + a) 0 !! 50
\is how you write an anonymous function in Haskell (also known as lambda in some other functional languages). The symbol
\is supposed to resemble the letter λ (lambda), which is used to write anonymous functions in lambda calculus. --Spoon! 10:59, 26 November 2011 (UTC)
Some nice contributions made in Haskell have been submitted as quoted code squashed, for some reason, into a "one-liner" format.
A Rosetta line consists of 80 chars at most. Perhaps drop the "one-liner" framing, which costs legibility without adding value ?
Ormolu is a good standard formatter.