#-----------------------------------------------------------
#
# Sample code
#             The Mandelbrot set
#
#-----------------------------------------------------------

F(x,y,z,w)=((w>100)?(0.1):((real(z)**2+imag(z)**2>10000.0)?\
              (0.001*w):(F(x,y,z*z+x+y*i,w+1))) );

m_half=surface{[F(x,y,0,0)][x=-1.8:0.8][y=0.0:1.1]\
               [sample=200:100]};

Mand=object{
          m_half;
          pushmatrix
           scale 1.0,-1.0,1.0
             m_half;
          popmatrix;
      };
#-----------------------------------------------------------
center;
plot2d Mand;
#-----------------------------------------------------------
