HP Forums
Just another Mandelbrot Set plot. - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Just another Mandelbrot Set plot. (/thread-16978.html)



Just another Mandelbrot Set plot. - matalog - 05-19-2021 09:02 PM

Here is a little Mandelbrot I wrote on the ZX Spectrum years ago, and just added a bit of colour so it looks better on the calc. It will save itself if you have the patience to let it finish.

Code:
EXPORT mand()
BEGIN
 LOCAL a,b,i,h,q,v,w;
 LOCAL x,y,t;
RECT();
 i:=20;
 FOR b FROM 0 TO 240 DO
  FOR a FROM 0 TO 320 DO
   h:=a/120-1.7;
   v:=b/120-1;
   x:=h;
   y:=v;
   q:=0;
  t:=0;
   REPEAT
  t:=t+1;
    w:=x*x-y*y;
    IF (x*x+y*y)>4 THEN BREAK(1); END;
    IF q>=i THEN PIXON_P(a,b,0); BREAK(1); END;
      y:=2*x*y+v;
      x:=w+h;
      q:=q+1;
    PIXON_P(a,b,q*8000);
   UNTIL 0;
  END;
 END;
AFiles("mandel2.png"):=G0;
END;



RE: Just another Mandelbrot Set plot. - Liamtoh Resu - 05-19-2021 10:43 PM

Thanks for the program.

I've had the prime for just a week now and got your program into it
via hp connectivity kit.

I stall have my ts1000. It looks like it would be interesting to port it
to atari 800 emulator.

Thanks again.