Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Black color for main object in Mandelbrot Set

19 views
Skip to first unread message

George Kalas

unread,
Jan 12, 2012, 3:35:15 PM1/12/12
to
Hi everyone,

The following Maple 9 code produces the Madelbrot Set:

with(plots):

MS:=proc(x,y)
local m,z,c;
c:=evalf(x+y*I);
m:=0;z:=0;
to 100 while abs(z)<2 do #100 is the iterations, 2 is the bailout
z:=evalf(z^2+c);
m:=m+1;
od;
log(m);
end:

cx:=0:
cy:=0:
wx:=2:
wy:=wx:

plot3d(MS, cx-wx..cx+wx, cy-wy..cy+wy, grid=[200,200], shading=ZHUE,
style=PATCHNOGRID, orientation=[-90,0], axes=BOX);

Does anyone see a quick way to change the color of the main set to black instead
of red?

The way I see it, ZHUE assigns a color to a color palette which comes from 0 to
100 iterations. Is there a way to except the main object from the ZHUE and color
it black or do I have to explicitly add code for it?

Thanks,
--
I.

acer

unread,
Jan 13, 2012, 10:30:49 PM1/13/12
to
Using your `MS` procedure,

P:=plot3d(MS, cx-wx..cx+wx, cy-wy..cy+wy, grid=[200,200],
shading=ZHUE, style=PATCHNOGRID):

display( plot3d(-0.1,x=-2..2,y=-2..2,color=black),
P, view=-0.1 .. log(99.5),
orientation=[-90,0], axes=BOX );

So, all that has been done is to lay it over a black background
( level plane, z=constant),
and to use a `view` which eliminates the topmost portion (m=100). This
allows the black background
to show through the opening. Rotate the whole displayed final 3d plot,
to see more.

- acer

I.N. Galidakis

unread,
Jan 14, 2012, 6:16:56 AM1/14/12
to
Thanks. Works perfectly.
--
I.
0 new messages