I've recently took up an intrest in fractals. Now I would like to write a program so I can draw one, specifically the mandelbrot set. My problem is i don't know how to use imaginary numbers in C, i'm using Bordland C++ 3.0 but also have DJGPP. The equation for drawing the mandlebrot set is f(n) = f(n)^2 + C. Now my constant C = 1 + i and my first point, f(n), is 2+i.
So f(n) = (2+i)^2 + 1 + i. I can do this out by hand, I get
4 + 4i + i^2 + 1 + i which simplfies to 4 + 5i. I use that in my next iteration. I need to find out how to use imaginary numbers in C or where I can get a library so I can use them. Thanks for any help.