On Sun, Mar 16, 2008 at 12:06 PM, Adam Majewski <adammaj1 at o2.pl> wrote:
> Adam Majewski pisze:
> > Here is last version.
> > It works only up to 5 iteration ,
> > http://fraktal.republika.pl/images/lemniscates5.png
> > because 6 curve is not precise ( on my computer ).
> > http://fraktal.republika.pl/images/lemniscates6.png
> > I use png file because svg gives me only black color.
> >
> > =================== code =============================
> > load(implicit_plot); /* package by Andrej Vodopivec */
> > c: x+%i*y;
> > ER:2; /* Escape Radius = bailout value it should be >=2 */
> > f[n](c) := if n=1 then c else (f[n-1](c)^2 + c);
> > ip_grid:[100,100];
> > ip_grid_in:[15,15];
> > my_preamble: "set zeroaxis; set title 'Boundaries of level sets of
> > escape time of Mandelbrot set'; set xlabel 'Re(c)'; set ylabel 'Im(c)'";
> > implicit_plot(makelist(abs(ev(f[n](c)))=ER,n,1,6),
> > [x,-2.5,2.5],[y,-2.5,2.5],[gnuplot_preamble,
> > my_preamble],[gnuplot_term,"png size 1000,1000"],[gnuplot_out_file,
> > "lemniscates6.png"]);
> > ==========================================
> >
> > Can it be done better ?
> >
> > Adam
> If it can't be done better ( no answers )
> then thx very much for help. (:-)
> The result with explanantion is on:
> http://commons.wikimedia.org/wiki/Image:Lemniscates5.png
Sometimes it takes more than just one day to get an answer ;)
In drawing f[6] you get a bad image because of floating point error.
You can trick implicit_plot to do computations in higher precision.
implicit_draw will draw the boundary of the region where the function
has negative value. You can define a function f6 which computes the
sing of f[6] using bigfloats and then plot f6:
f6(x,y):=
block([x:bfloat(x), y:bfloat(y)],
if abs(''(f[6](c)))>2 then 1 else -1)$
fpprec:32$
implicit_plot('(f6(x,y)), [x,-2.5,2.5], [y,-2.5,2.5]);
or all 6 curves:
implicit_plot(
append(makelist(abs(ev(f[n](c)))=ER,n,1,5), ['(f6(x,y))]),
[x,-2.5,2.5],[y,-2.5,2.5]);
HTH,
--
Andrej