Thread: MandelBrot

  1. #16
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    United Kingdom
    Nonoob is right about the '+' sign (Please refer to the pseudocode I quoted in my first post).

    Also, you will have to play around with the coordinates considered to make sure you get it on the right length scales.

    Although to be perfectly honest, I can't see the point of drawing this code in the console because you will lose all the fractal nature which makes it interesting. If you use the code given using the windows api you get something similar to the attached image. I admit the colour scheme leaves much to be desired, but you get the picture - No pun intended.

    In the attached picture I used the transformation equations:
    x = 0.6*( (1.0*col/max_col) - 3.5 );
    y = 0.4*( (1.0*row/max_row) - 3.5 );
    So like I said, you will have to play around with the numbers a bit to get it looking good.

    Your code is quite confusing because you use while loops when a for loop would be much more suited to the task (and it would make the code easier to read).

  2. #17
    Registered User
    Join Date
    Oct 2010
    Quote Originally Posted by nonoob View Post
    i = 2 * r * i * y;
    ... I think this should be +
    I love you.

    I rewrote the code today with for loops, which are much better for this type of thing.

    Thanks for all your help, its massively appreciated!
    Last edited by Chems; 10-26-2010 at 03:07 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. mandelbrot set program improvements
    By mad_muppet in forum Game Programming
    Replies: 3
    Last Post: 07-14-2010, 05:58 AM
  2. Problems with timeval
    By ErMenGoL in forum C Programming
    Replies: 3
    Last Post: 04-22-2010, 10:59 AM
  3. Mandelbrot tutorial?
    By PseudoSane in forum C Programming
    Replies: 7
    Last Post: 11-07-2006, 02:02 PM
  4. I want to draw a mandelbrot set ..
    By mad_muppet in forum C Programming
    Replies: 16
    Last Post: 08-18-2006, 12:43 AM
  5. ugly mandelbrot set :(
    By Horse22 in forum C++ Programming
    Replies: 3
    Last Post: 02-26-2005, 03:55 PM