home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0600 / CCE_0627.ZIP / CCE_0627.PD / HENDYMN / README.DOC < prev    next >
Text File  |  1992-06-29  |  21KB  |  547 lines

  1.                              CONTENTS
  2.  
  3. Line  12 The Mandelbrot Set - an introduction.
  4. Line  30 Running the program - an overview.
  5. Line 175 Some notes on the Maths libraries.
  6. Line 217 What the Mandelbrot and Julia Sets are all about.
  7. Line 291 Full description of the program options.
  8. Line 337 How to set your own defaults.
  9. Line 511 The bit at the end.
  10.  
  11.  
  12.         THE MANDELBROT SET - AN INTRODUCTION
  13.  
  14. Once upon a time in a land far, far away there lived a bloke by the name
  15. of Benoit `Benny' Mandelbrot.  He was quite into Mathematics and
  16. discovered the imaginatively named `Mandelbrot Set'.  This is like a map
  17. which can be magnified and magnified and further magnified without getting
  18. dull, whereas most maps are staggeringly dull whether you magnify them or
  19. not.
  20. The technology to produce such weird images as the basic Mandelbrot 
  21. Set (which you see immediately after the title screens) hasn't been around
  22. for very long and no one really understands what's going on or why such
  23. images are produced. But they do look great, so who honestly cares?
  24. Associated with each place in the Mandelbrot Set, there is another image
  25. called the `Julia Set' for that point. This program allows you to 
  26. investigate both types of image.  Prepare thy retinas for a bashing and
  27. enter the world of Chaos ....
  28.  
  29.  
  30.         RUNNING THE PROGRAM - AN OVERVIEW
  31.  
  32. The first thing to do, as always, is to make a backup copy of the disk.
  33. It is a good idea to hide the original disk somewhere away from drunk
  34. people, dogs, cups of tea, pterodactyls, etc.... The program can be run
  35. from the desktop by double clicking on the file HENDYMAN.PRG
  36. After the title screen, the program will plot the default image. When
  37. you run the program for the first time, this image will be the basic
  38. Mandelbrot Set. Once this has been done, the program gives you a gun-sight.
  39. Once you have decided which bit of the image you want to magnify, all you
  40. have to do is:
  41.  
  42. * Select the centre with the gun-sight.
  43.  
  44. * Click on the left mouse button to set it.
  45.  
  46. * Move the mouse to define the new image inside the flashing box.
  47.  
  48. * Click on the left mouse button again to plot this new image.
  49.  
  50. I have found that people can sit quite happily for hours and play with
  51. this, even people who don't like computers and think that mathematics
  52. is amazingly dull.
  53.  
  54. If the right mouse button is clicked whilst the gun-sight is on the screen,
  55. the control panel magically appears.  Clicking the right mouse button again
  56. gives you back the gun-sight (i.e. this toggles the control panel). This is
  57. the only thing that the right mouse button is used for - everything else is
  58. is controlled by the left button.
  59. This control panel enables you to set up various screen effects. These are
  60. described in detail later.
  61.  
  62.  
  63.             DEPTH
  64.  
  65. Perhaps the most important variable is the `depth' variable. As the
  66. magnification increases you will find, generally, that you will need to
  67. increase this number to pull out more detail in your images and, in fact,
  68. to see anything at all. The setting of the depth variable is best learnt
  69. by experiment. However, if you have plotted an image and it looks a bit
  70. bare, with clearly-defined smooth edges as opposed to crinkly multicoloured
  71. ones, then the best thing to do is increase the `depth' variable by about
  72. 30 or 40 and then redraw the screen (click on centre of monitor, expand the
  73. box to the whole screen and click again).
  74.  
  75.  
  76.         INTERRUPTING IN MID-PLOT
  77.  
  78. All you have to do is hold both mouse buttons down simultaneously to stop
  79. the plotting.  This gives you the gun-sight back. Now you can either carry
  80. on zooming in or you can press the right mouse button to bring up the
  81. control panel.
  82.  
  83.  
  84.             FRACTAL
  85.  
  86. The Mandelbrot Set is really a summary of the corresponding Julia Sets.
  87. Confused? Good.
  88. Every point in the Mandelbrot Set image has a Julia Set to itself.  Each
  89. Julia Set can be magnified indefinitely, but, unlike the Mandelbrot Set,
  90. they are quite obviously self-similar. Even more confused?  Even better.
  91. `Self-similar' means that magnifying a part of an image results in a new
  92. image which looks the same as the one that you started with. You can carry
  93. on magnifying, and it will carry on looking the same.
  94.  
  95. You can plot the Julia Set for the point you are centered on by clicking
  96. on `Fractal' in the control panel.
  97. You can investigate this new image as normal, zooming in and out, changing
  98. the depth, rotating the colours, etc., etc., etc.,  and to return to the
  99. place you came from in the Mandelbrot Set, click on `fractal' again.
  100.  
  101. It is interesting to note that all of the black in the Mandelbrot Set is
  102. connected - there is only one black area.  It may seem that there are many
  103. areas of black surrounded by colour, but there is always a black path
  104. leading through the colour and joining the black areas together.
  105.  
  106.  
  107.             ROTATE
  108.  
  109. Many hours of fun can be had by just zooming into the Mandelbrot Set and
  110. maybe having the odd shifty at the Julia Set for the point at which you
  111. are looking (always the middle of the screen).
  112. You might also want to rotate the colour palette whilst your image is 
  113. being generated:
  114.  
  115. * Interrupt the plotting by pressing both mouse buttons simultaneously.
  116.  
  117. * Call up the control panel by pressing the right mouse button.
  118.  
  119. * Click on `Rotate'.
  120.  
  121. Click on `STOP/GO' to get it spinning, click on `IN/OUT' to change
  122. direction, and alter the Electrolux spin-speed to taste using the arrows.
  123. When you are happy, `Exit' and then `Continue' from the control panel.
  124. Weird isn't it.
  125.  
  126.  
  127.             NEOCHROME FILES
  128.  
  129. When you have found a cool image and you want to save it to disk, yes,
  130. you've guessed it, click on `Disk' on the control panel. This allows you
  131. to save images in two different ways:
  132.  
  133. * As a list of parameters - numbers which describe your image.
  134.  
  135. * As a "picture file" - the image stored exactly as it appears on the
  136. screen. 
  137.  
  138. These "picture files" are Neochrome files, and are very big indeed (32K or
  139. 5 percent of a 726K disk). On the other hand, the parameter files are very
  140. small indeed and still contain all the information needed to regenerate
  141. your image, provided that you don't mind waiting for it to be replotted.
  142.  
  143. When you save a .NEO "picture file", the computer also saves the parameters
  144. for the image. It does this because without this .PAR file of numbers, you
  145. would only be able to display the picture and would not be able to carry
  146. on zooming in.
  147.  
  148. WARNING - If you accidentally lose a .PAR file, the image is lost for good.
  149. The computer must have this file in order to load your saved image, and
  150. cannot simply load the "picture file". To prevent accidental loss, all .PAR
  151. files are created in a "write-protected" state, so if you want to delete
  152. any, you must do so very deliberately. If you want to delete a lot of these
  153. then the best way of doing so is probably to reformat the disc.
  154.  
  155. Loading a .PAR file causes the program to automatically start regenerating
  156. the image.  If you just want to remember a nice image and don't want to
  157. use up disk space, save it as a .PAR . You can save well over 6,000 .PAR
  158. files on one 726K disk compared with only 22 .NEO files.
  159.  
  160.  
  161.             SPEED
  162.  
  163. One way to produce an image is to calculate the colour of every pixel on
  164. the screen.  This is fast, but there is a faster way to produce an
  165. image which is insignificantly different. This involves leaving out some
  166. pixels and filling them in later. So the `SLOW' option calculates every
  167. pixel, and the `FAST' one is a bit cleverer and a lot quicker.
  168. This option is here because, in really strange circumstances, the `FAST'
  169. option might produce a slightly incorrect or distorted image, so
  170. you the user have the power to see the perfect one if you don't mind
  171. waiting longer. In tests, 99.9999 % of cat owners couldn't tell the
  172. difference between the `FAST' and `SLOW' options!
  173.  
  174.  
  175.         SOME NOTES ON THE MATHS LIBRARIES
  176.  
  177. DISCLAIMER: This program works perfectly well with automath always set to
  178. `ON', which automatically chooses all the maths routines for you. However,
  179. if you do wish to turn automath `OFF' and choose for yourself, then you
  180. can.
  181.  
  182. In this program, there is a lot of talk about `Maths routines'. What are
  183. they? Well, in order for the computer to be able to calculate any images
  184. and to show anything on the screen at all, it has to be able to add,
  185. subtract, multiply, divide and do lots of other things with numbers. This
  186. may appear obvious, silly and trivial, but it's not as easy as it sounds.
  187. The numbers which have to be remembered and used can be very big or very,
  188. very small. For example, if you zoom in only four or five times, then the
  189. computer is working with about 0.0001 for the sides of the image! And at
  190. the same kind of magnification, you may need five hundred to a thousand
  191. for the iteration depth in order to see all of the detail, so we must be
  192. able to cope with a huge range of numbers at the same time.
  193.  
  194. A `Maths routine' or `Maths library' is a bit of program which can do
  195. these things - addition, multiplication and so on. Each one can handle a
  196. different range of numbers and takes a different length of time to work out
  197. the answer. This program has seven different libraries - like having seven
  198. different people whom you can ask to do a calculation, e.g.
  199.  
  200. Fred  can multiply numbers between 1 and 100 and takes 1 minute every time.
  201.  
  202. Freda can multiply numbers between 1 and 500 and takes 2 minutes. 
  203.  
  204. John  can multiply numbers between 1 and 1,000 and takes 5 minutes.
  205.  
  206. Joanna can multiply numbers between 1 and 100,000 and takes 10 minutes.
  207.  
  208. ... and so on.
  209.  
  210. Now, you know that Joanna will always be able to give you the answer, but
  211. she will always take ten minutes. If you are only using small numbers, then
  212. it will be much quicker to ask Fred. So, you must look at the numbers that
  213. you are dealing with and decide who to ask. This is what the program does
  214. when automath is `ON'.
  215.  
  216.  
  217.     WHAT THE MANDELBROT AND JULIA SETS ARE ALL ABOUT
  218.  
  219. All of the action takes place in something called the `Complex
  220. Plane' as Mathematicians say, just to confuse everyone. The
  221. pretty images are generated by a remarkably short and simple program.
  222. Whereas the version on your `Trendy Handy Randy Hendy Bendy Mandy' disk
  223. is written in nice and fast assembly language, it can also be written in
  224. a language such as basic. Below is a program in basic that will plot the
  225. Mandelbrot Set:-
  226.  
  227. 10 sx=0 : for cx = -2 to +2 step (4/320)
  228. 20 sy=0 : for cy = -2 to +2 step (4/200)
  229. 30 gosub 100
  230. 40 plot (sx,sy,colour)
  231. 50 sx=sx+1 : Next cx
  232. 60 sy=sy+1 : Next cy
  233. 70 end
  234.  
  235. 100 x=0 : x2=0
  236. 110 y=0 : y2=0
  237. 120 count=0
  238. 130 y=2*x*y+cy
  239. 140 x=x2-y2+cx
  240. 150 y2=y*y
  241. 160 x2=x*x
  242. 170 count=count+1
  243. 180 If count = 30 then colour=0:Return
  244. 190 If x2+y2 >= 4 then colour=count:Return
  245. 200 Goto 130
  246.  
  247. As you can see, this program is not overly complicated.  It is
  248. just two `FOR-NEXT' loops which select every pixel on the screen and
  249. decide what colour to plot it in using the subroutine at line 100.
  250.  
  251. The screen can be regarded as a piece of squared `graph' paper. Each pixel
  252. on the screen is referenced by a pair of co-ordinates - e.g. the pixel at
  253. the middle of the screen is (0,0) and the top right hand corner is (2,2).
  254. This means that some pixels are evidently not referenced by integers - you
  255. can have a pixel at (0.5,0.3).
  256.  
  257. The colour for each point depends only upon its co-ordinates.
  258. This program simply works like a production line. In one end you put a
  259. stream of co-ordinates - (0,0) (0,1) (1,1) (0.3,7) (-2,0.5) - and out of
  260. the other end come the correct colours for each of these pixels - red,
  261. blue, yellow, green, black. As soon as these colours emerge from the
  262. production line, they are plotted on the screen. This is why the image is
  263. gradually built up line by line.
  264.  
  265. The colour is calculated from the co-ordinates by a process of repeated
  266. iteration. The point is transformed into another point by a set
  267. Mathematical method. This new point is similarly transformed into another
  268. new point, and this process is repeated until you get a point which is
  269. outside of a certain region on the `graph' paper (a circle of radius 2
  270. around the center of the paper). The colour of the starting point is very
  271. simply the number of transformations, or `iterations', performed before the
  272. resulting point leaves the circle.
  273.  
  274.  
  275.             EXAMPLE
  276.  
  277. To find the colour for point (1,1) - first transformation produces new
  278. point (0.3,0.5) which is still inside the circle - transforming this new
  279. point produces (1.1,-0.2) which is still inside the circle - transforming
  280. this point produces (2.5,1.3) which is outside the circle. Therefore, the
  281. pixel at (1,1) is plotted in colour 3 because it took 3 iterations to
  282. produce a point outside of the circle.
  283.  
  284. The iteration depth (controlled by the `Depth' option in the control panel)
  285. sets the maximum number of transformations which the computer allows itself
  286. to perform on any point. If after this maximum number of iterations, the
  287. point produced is still inside the circle, then it is plotted in black and
  288. the program continues to the next point fed into the production line.
  289.  
  290.  
  291.     FULL DESCRIPTION OF THE PROGRAM OPTIONS
  292.  
  293. Quit    This returns you to the desktop or where-ever. Note that
  294.     this only works on an Atari 1040ST at the moment.  If you have
  295.     an STe then `Quit' will not work properly and you will need to
  296.     reset the computer, I'm afraid. Sorry about this, but I haven't
  297.     had the time to run more thorough tests on the STe.
  298.  
  299. Restart    This returns the program to the state it was in when it was
  300.     originally loaded.
  301.  
  302. Info    General information about the program
  303.  
  304. Disc    File selector allowing loading and saving of .NEO and .PAR type
  305.     files.
  306.  
  307. System    Gives the `at a glance' state of the variables and flags.
  308.  
  309. Depth    Iteration depth entry for bringing out detail.  Numbers can be
  310.     entered directly from the keyboard or by using the arrows.
  311.  
  312. Rotate    Palette rotation controls.
  313.  
  314. Continue    Continues a plot which had been interrupted.
  315.  
  316. Copyright    Slightly modified legal protection for the programmer.
  317.  
  318. Fractal    Switches between Mandelbrot and Julia Sets. If you can't remember
  319.     which type of image you are currently investigating, then look at
  320.     the `SYSTEM' option (above).
  321.  
  322. Speed    Toggles between slow and fast plot algorithm.
  323.  
  324. Aspect    Selection of Full Screen AND/OR Aspect Ratio Correction.
  325.  
  326. Quickmath    Activates fastest maths library and over-rides all other maths
  327.     format options. If this maths format will not give an accurate
  328.     image, then this option will be automatically disabled and the
  329.     best, most economical format will be selected instead.
  330.  
  331. Automath    When set, program automatically chooses `best' maths format.
  332.  
  333. Maths    When Automath and Quickmath are both `OFF', allows the user to
  334.     select the maths routines used.
  335.  
  336.  
  337.         HOW TO SET YOUR OWN DEFAULTS
  338.  
  339. Note that after starting up, the program looks for a HENDYMAN.DEF file
  340. with which to initialise the system variables. A personal default file can
  341. be created and saved so that you can get the program doing just what you
  342. want as soon as it loads.  If this file is not in the starting-up
  343. directory, the program will use its own preset defaults.
  344.  
  345. This section describes all of the variables and flags that can be placed in
  346. the file HENDYMAN.DEF. These do not have to appear in any particular order,
  347. but they must be spelled correctly, otherwise they will be ignored!
  348.  
  349.  
  350. cx0 and cy0
  351. -----------
  352.  
  353. These two numbers together define the centre of the Mandelbrot or Julia Set
  354. image in the plane as a pair of co-ordinates.
  355.     Defaults to cx0=0, cy0=0.
  356.  
  357.  
  358. sidecx and sidecy
  359. -----------------
  360.  
  361. These two numbers together define the side lengths of the image -  how much
  362. of the set around the centre, (cx0,cy0), that you want to display full
  363. screen. In other words these two numbers define the magnification of the
  364. image.
  365.     Defaults to sidecx=5.69, sidecy=4.
  366.  
  367.  
  368. sidesx and sidesy
  369. -----------------
  370.  
  371. These two numbers can be used to redefine the size of the Atari screen.
  372. This is useful for `having a quick look' at things because instead of
  373. plotting images 320 by 200 you can plot them, say, 80 by 50.  This divides
  374. the time taken to plot them by four.  All images are automatically centered
  375. on the Atari screen in this version.
  376.     Defaults to sidesx=320, sidesy=200.
  377.  
  378.  
  379. depth
  380. -----
  381.  
  382. This number defines the iteration `depth' used in the default image. This
  383. can be changed directly whilst the program is running.
  384.     Defaults to depth=30.
  385.  
  386.  
  387. pxm and pym
  388. -----------
  389.  
  390. These are distortion constants to `mangle' Mandelbrot Set images.  These
  391. new images are direct cousins of the basic Mandelbrot Set we all know and
  392. love, unlike the Julia Sets, which are generated in a different way.
  393.  
  394. If you choose large (i.e. greater than about 1.4) values for
  395. either of these constants, then it is possible that the plotting will slow
  396. down noticeably. This is because more powerful maths libraries must be used
  397. which are slower. This is not a serious problem because distorted
  398. images from large distortion constants are really quite boring. If you 
  399. don't believe this then try it for yourself.
  400.     Defaults to pxm=0, pym=0.
  401.  
  402.  
  403. pxj and pyj
  404. -----------
  405.  
  406. These two distortion constants `mangle' Julia Set images in exactly the
  407. same way as those that `mangle' the Mandelbrot Set images described above.
  408.     Defaults to pxj=0, pyj=0.
  409.  
  410.  
  411. max_error_mand and max_error_juli
  412. ---------------------------------
  413.  
  414. These two constants give the automath option the information for `deciding'
  415. when to advance to a more powerful maths library.  If these are set too
  416. high, say both at 10, then  sooner or later you will see images begin to
  417. break up and finally become very untidy and ragged.
  418. If you feel that an image is tending towards this raggedness and you want
  419. to go to a more powerful maths library to make sure of a correct image,
  420. then turn automath `OFF' and increase `Maths' by one in the main program
  421. control panel.
  422.     Defaults to max_error_mand=1, max_error_juli=1.
  423.  
  424.  
  425. fractal
  426. -------
  427.  
  428. This chooses which fratal is plotted as the default image. The Mandelbrot
  429. set is 0, Julia sets are 1.
  430.     Defaults to fractal=0.
  431.  
  432.  
  433. speed
  434. -----
  435.  
  436. Chooses between fast and slow plotting algorithm. Fast is 1, slow is 0.
  437.     Defaults to speed=1.
  438.  
  439.  
  440. aspect
  441. ------
  442.  
  443. Chooses default options for `Aspect ratio' and `Full screen'.
  444.  
  445. 0 - Full Screen OFF Aspect OFF.
  446.  
  447. 1 - Full Screen OFF Aspect ON.
  448.  
  449. 2 - Full Screen ON  Aspect OFF.
  450.  
  451. 3 - Full Screen ON  Aspect ON.
  452.  
  453.     Defaults to aspect=1.
  454.  
  455.  
  456. quickmath
  457. ---------
  458.  
  459. Default option as to whether the `Quickmath' maths routines are enabled on
  460. starting up. ON is 1, OFF is 0. Note that when this option is set, you may
  461. see a little distortion in the images produced at higher magnifications.
  462. It probably won't be noticeable, but if it is then you should turn off
  463. quickmath and future images will be accurate. The program will do this
  464. anyway if it thinks there is too much distortion.
  465.     Defaults to quickmath=1.
  466.  
  467.  
  468. automath
  469. --------
  470.  
  471. Default option as to whether the `Automath' maths routines are enabled on
  472. starting up, and only has any effect if `Quickmath' is `OFF'. ON is 1,
  473. OFF is 0.
  474.     Defaults to automath=1.
  475.  
  476.  
  477. maths
  478. -----
  479.  
  480. Chooses the default maths library, and only has any effect if both
  481. `Quickmath' and `Automath' are `OFF'. Libraries are numbered from 1 to 5,
  482. with 1 being least powerful and fastest, and 5 being most powerful and
  483. slowest.
  484.     Defaults to maths=1.
  485.  
  486. An example of setting ALL of the defaults is the file hendyman.def which
  487. should be on this disk. This contains the following:-
  488.  
  489. cx0        =    0
  490. cy0        =    0
  491. sidecx        =    5.69
  492. sidecy        =    4
  493. sidesx        =    320
  494. sidesy        =    200
  495. depth        =    30
  496. pxm        =    0
  497. pym        =    0
  498. pxj        =    0
  499. pyj        =    0
  500. max_error_mand    =    1
  501. max_error_juli    =    1
  502. fractal        =    0
  503. aspect        =    1
  504. speed        =    1
  505. quickmath        =    1
  506. automath        =    1
  507. maths        =    1
  508.  
  509.  
  510.  
  511.         THE BIT AT THE END
  512.  
  513. I'm planning to expand the program to do plenty of other weird stuff
  514. whilst keeping the thing usable by people who aren't interested in the
  515. maths side of it. Since this has been released as Shareware, I can only
  516. do this and give YOU more features if I get some feedback from THIS 
  517. version.
  518. It seems that the big companies that get fat selling software for 
  519. horrendous prices have failed to kill off Shareware. This means that there
  520. are enough people out there who have realised that everybody (except big
  521. money-grabbing companies) benefits from the Shareware idea.
  522. If you think that this software is wikked, and want to see newer and
  523. better versions, then please send five pounds to:
  524.  
  525. HeNdYsOfT,
  526. 4 Lordswood,
  527. Silchester,
  528. Reading,
  529. Berks,
  530. RG7 2PZ.
  531.  
  532. Also, if anybody finds any unexpected `features' (i.e bugs) in the program
  533. then I would greatly appreciate a note.
  534. Any suggestions or criticisms are also welcomed.  Tally Ho......
  535.  
  536. Endorsment:
  537.  This software was developed on an old battle-scarred Atari 1040ST called
  538.   'Herman', with a knackered mouse and a very ill disk-drive.
  539.     All coding by Hendy The Mad Mathemagician.
  540.  
  541. The `Cheers folks section'
  542.  
  543. Many Thanx to the YAK for encouragement, Irni for being awesomely 
  544. intelligent, Lee for the use of his `High Level' brain and the zoom box
  545. actioning, Keeff The Tall Thin Being for the design of half of the disk
  546. interface and you for trying out this program.
  547.