Hi! I'm writing a little program to generate images of the Mandelbrot set and other sets. The thing is i would like to have something like ./Mandelbrot -function z*z*z + c
But i have no idea on how to make this parametrizable and detect the formulas. I would write a little helper function to detect at least the simple ones like z^smth + c but if i want to use other stuff like
f(z) = | z | ^ 2 + c its gonna be too complicated for me to do it..
So, any solution for this or I should give up on the idea?
Actual code for the actual implementation:
c := m.getImaginaryNumber(x, y) z := complex128(0) var i int for i = 0; i < m.iters && cmplx.Abs(z) <= 2; i++ { z = z*z + c //parametrize??? } //crazy, give up if i == m.iters { return 0 } [link] [留言]