The Museum of HP Calculators

HP-28{C|S}: Mandelbrot

Copyright (C) 2002 Glen Kilpatrick

Distributed under GNU General Public License

This program is supplied without representation or warranty of any kind. The author and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Description

I hardly need introduce Benoit B. Mandelbrot's fascinating discovery. A Google search on "Mandelbrot Set" turned up "about 35,900" hits as I was writing this; many of them will probably give a better introduction than I can, so I'm going to completely pass over what it is, and describe how to compute it.

Notes

This just fits in an HP-28C, and if you have an S, leaves room for other stuff as well (more RAM there). Note the solo input is an integer that specifies the number of iterations to qualify for set inclusion. And be warned, this will take many hours to compute a graphic, better buy replacement batteries now. And while I haven't owned an HP-28 for many years, and may not be very useful for support, you're always welcome to ask....

A Google search on "Glen Kilpatrick" turned up an Australian chap who plays some sort of "foot" ball, and some HP-28 code listings I'd forgotten about:

Example

32 Mndlbrt
and wait a long time for it to compute and display, pixel by pixel, the Mandelbrot Set. My notes don't indicate reasonable values for that integer, so 32 is merely a guess; pixels "far" from the set will be passed over rapidly, while those within the set will go the course, be turned on only when the interation count is hit.

Program Listing

\<< \-> b \<< b 'BntB' STO \<< X PPAR 1 GET IM PPAR 2 GET IM DUP2 SWAP -
31 / PPAR 4 GET * \-> cR ym yM yl \<< ym yM FOR cl cR cl R\->C (0,0) 0
\-> c z n \<< DO n 1 + 'n' STO z SQ c + 'z' STO UNTIL n BntB > z ABS 2 >
OR END IF n BntB > THEN c PIXEL END \>> yl STEP \>> PPAR 5 GET IM \>>
STEQ CLLCD DRAW { EQ BntB } PURGE \>> \>> 'Mndlbrt' STO

Resources Used

This program takes most of the RAM of an HP-28C, and on any HP-28 takes a lot of the batteries.... Otherwise, it's a standalone program, takes one argument from the stack, returns a graphic to the screen.


Go back to the software library
Go back to the main exhibit hall