home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk371.lzh / Fractals / frac.doc < prev    next >
Text File  |  1990-10-08  |  36KB  |  1,040 lines

  1.       (C) 1990- Programgjörarna, Ronnie.
  2.  
  3.       Hello to all of you reading this file.
  4.       This program is dedicated to Mr Stallman of MIT.
  5.       He wrote EMACS and have developed GNU ( Gnu Not Unix ).
  6.       He is also considered to be the best programmer in the world, ever.
  7.       We all want to be as skilled programmers as Mr Stallman,
  8.       and to be called Hackers.
  9.       ( see below for definition of hacker. )
  10.  
  11.  
  12.       FIRST OF ALL:
  13.       We take no responibility whatsoever regarding the function of this
  14.       software, you use it on your own risk.
  15.       This program is as it is, with no warranty.
  16.       If you use it and it crashes your computer or destroys some data
  17.       or makes any damage in any other way, we take no responsibility.
  18.       Thou hast been warned.
  19.  
  20.       This software consists of 10 files:
  21.            The seven source files:
  22.                frac.c          / main program
  23.                menu.c          / variabel declaration and
  24.                                  initialization for menus and stuff.
  25.                formulas.c      / calculation formulas
  26.                formulas1.c     / formulas for menu 2
  27.                wilbm.c         / function that writes picture as iff-ilbm
  28.                colorwindow.c   / colorwindow function
  29.                defs.h          / constant definitions
  30.  
  31.  
  32.            The executable program file with icon:
  33.                frac            / executable program
  34.                frac.info       / program icon
  35.  
  36.            The documentation file:
  37.                frac.doc        / this file
  38.  
  39.       HOW TO COMPILE THE SOURCE:
  40.       We have used Aztec c v. 3.6 to compile the program,
  41.       but I think it will work with Lattice as well.
  42.  
  43.           cc menu
  44.           cc frac
  45.           cc formulas
  46.           cc formulas1
  47.           cc colorwindow
  48.           cc wilbm
  49.   ln frac.o menu.o formulas.o formulas1.o colorwindow.o wilbm.o m.lib c.lib
  50.  
  51.       It uses Motorola fast floating point to gain some speed.
  52.  
  53.       NOTE. The program needs mathtrans.library, so if you use a
  54.       modified workbench diskette to boot from, make sure you
  55.       have this library in the LIBS directory.
  56.  
  57.  
  58.  
  59.       FIRST WE WANT TO MAKE CERTAIN THINGS CLEAR:
  60.       This is public domain, that is, you may copy this software and
  61.       give to your friends if you like.
  62.       ( If you like the program, we would in fact appreciate if you
  63.         spread it as much as you could. )
  64.       But there are certain rules that you MUST obey if you do so,
  65.       1, You may not SELL the program, that is, take money for giving
  66.          someone a copy.
  67.       2, You may not ALTER the code or text files.
  68.          This one is IMPORTANT, I don't care very much if you break the
  69.          other rules, but you may NOT alter the code and spread the copy.
  70.       3, When you give someone a copy of this software, you must
  71.          copy all of these file.
  72.       4, If you use the program and like it, and you feel generous,
  73.          Please, buy me a beer if you meet me at Ryd's Herrgård in
  74.          Linköping.
  75.          ( In other words, this program is Beerware. )
  76.  
  77.  
  78. GREET DEPARTEMENT:
  79.       Greetings to ( in alphabetical order )
  80.       Klas Elmby,
  81.       Jonas Nywall
  82. and   Mr Richard Stallman.
  83.  
  84.  
  85. INFO:
  86.       We are some swedish students that are going to write some
  87.       software for the amiga and ibm-pc.
  88.       We call ourself programgjörarna ( program makers ).
  89.       We aim to write good public domain programs, and we want
  90.       YOU to use our programs. ( and like them )
  91.       We think Mr Stallman is God, and our religion is the language of C.
  92.       Please write to us if you ( like we do ) think Mr Stallman is
  93.       great and C is the ultimate language.
  94.       If you are a shithead that only writes useless demos or cracks
  95.       programs, don't bother.
  96.       We won't even read your letters.
  97.       We have ways to detect shithead letters without opening them.
  98.       If it smells like coca-cola and sweat, then it is from a programmer.
  99.       If it smells like shit, it is either from a cracker or a swapper,
  100.       'cos they don't wipe their asses when they go to the lavatory.
  101.  
  102.       If you enjoy programing the amiga or the ibm, you are welcome to
  103.       write to us, but please also send us an self addressed letter
  104.       with stamps on it if you do,
  105.       'cos I have no intention to spend a fortune mailing letters.
  106.       If you wish to contact us, write to my ( I'm Ronnie ) address
  107.       below.
  108.       Also if you have the p.d. program C-ROBOTS, and think your
  109.       robot will beat mine, send me your robot and my robot A-1 will
  110.       disintegrate it. ( or so I hope )
  111.  
  112.       We also plan to convert this program to IMB computers, ( only VGA and
  113.       super-VGA ), and Jonas Nywall had almost finished the first working
  114.       version of the program when his hard-disk crashed, unfortunately
  115.       he had no backups of the source files.
  116.  
  117.  
  118.  
  119.       If you are a user of a computer net ( such as DECNET/SUNET ) you
  120.       can reach me with e-Mail, my address is
  121.       ronnie@lysator.liu.se
  122.       ( Note that the computer runs unix and there's been some problems
  123.         reaching it from some vms machines, so I can not guarantee
  124.         that you'll get through to me. )
  125.       ( also note that the computer is down during the summer. )
  126.  
  127.       Note. If you are a swapper , a cracker or a demo-s.k. programmer
  128.       please, don't bother to write to us.
  129.       Coding YES,
  130.       Swapping NO.
  131.       We are not interested in swapping stolen programs,
  132.       We are REAL programmers, we CODE, not copy.
  133.  
  134.  
  135. HACKERS:
  136.       What is a hacker?
  137.       ( Mr Stallman is a Hacker )
  138.       ( In the late 60's at MIT, the young students that were very
  139.         skilled in programming computers were called hackers.
  140.         ( The keyboard sounds hack,hack,hack...  )
  141.         So, a hacker means someone that is very skilled in programming,
  142.         and can make a working program in little time. )
  143.       ( The word hacker are now used on people who steal and crack
  144.         programs, that is a misuse of the word.
  145.         These thiefs should be called crackers, and are known as
  146.         idiots. )
  147.  
  148.  
  149. SHITHEADS:
  150.       To all of you crackers out there:
  151.         We all wish you dead.
  152.         One should respect the very hard work of other programmers
  153.         and not steal their work, change a few bytes and take all
  154.         the credits of writing the program.
  155.         Shame on you.
  156.       To all of you swappers:
  157.         We all wish you dead too.
  158.         You don't even know how to use a computer properly,
  159.         you just distribute stolen software.
  160.         I do not have anything positive to write about you.
  161.       To all of you demo-programmers:
  162.         So called programmers.
  163.         Why don't you learn how to use a multitasking-op.sys. properly.
  164.         It isn't that hard.
  165.         The amiga is far more advanced than old 8-bit computers, why
  166.         do you not learn how to program it the way it should be ?
  167.         Is it to hard for you, to learn real programming ?
  168.         Do you think a real programmer would write a program that
  169.         sends the op.sys. with the express elevator straight up into
  170.         the big fast.mem. in heaven.
  171.         If he did, he would probably very soon be looking for another job.
  172.         No one needs a program that kills the system and forces you to
  173.         reboot the system.
  174.         What is the use of having a computer with the ( probably )
  175.         best op.sys. except from UNIX , when there are so many
  176.         shitheads out there that does their best to kill it .
  177.  
  178.         Why do you hate multitasking?
  179.  
  180.  
  181.  
  182.  
  183.         Enough of this, here comes the actual manual.
  184.                                Ronnie J, programgjörare.
  185.         ( OOPS, some of the stuff below are quite old, and are not
  186.           correct any longer, I hope you'll forgive me for that. )
  187.         ( as you may notice, I HATE writing docs, so therefore this doc
  188.           file isn't a very pretty sight, but at least it is a doc file. )
  189.  
  190.         Over and out.
  191.  
  192.  
  193.  
  194.  
  195.  
  196.       Frac.Doc
  197.  
  198.       Documentation to the fractal-generator FRAC
  199.       by Ronnie Johansson.
  200.  
  201.       ( This program is Public-Domain.
  202.         You may copy it and spread it as much as you like
  203.         as long as this textfile is not altered.
  204.         ( Except for typos, which I would appreciate if you
  205.           corrected when detected. )
  206.         I hope you will enjoy the program. ) )
  207.       ( PD-means you can do whatever you like with it,
  208.         if you like it : GREAT, have fun ,
  209.         if you don't   : Tough luck Buster. )
  210.  
  211.  
  212.       Ronnie Johansson Linköping, Sweden, 900421.
  213.  
  214.  
  215.  
  216.  
  217.  
  218.      Introduction.
  219.  
  220.      This program was made in late december 89 ,
  221.      My christmas vacation, for the sole purpose of impressing
  222.      one of my friends, and to persuade him to study math at
  223.      the Linköping University. ( As I do )
  224.      His name is Magnus Johansson in Intagan,Trollhättan and it is
  225.      all his "fault" that this program exists.
  226.      ( I hope he will become a mathematician too )
  227.  
  228.      My name is Ronnie Johansson, and I am studying math at
  229.      the Linëping University, second year.
  230.      I hope that I have corrected all the bugs in the program,
  231.      ( I do not know of any bug now ).
  232.      The program can generate many different fractals.
  233.      Note that all are generated by iterated complex formulas.
  234.      I am not very good at writing english, so when you find any
  235.      typos, PLEASE, do correct them.
  236.  
  237.      If you wish to contact me, you can reach me at
  238.         Ronnie Johansson
  239.         Hasselkulleg. 70
  240.         461 62 Trollèttan
  241.         Sweden
  242.  
  243.      Please do contact me if you detect a bug, or if you have any ideas
  244.      of how to improve the program.
  245.      Maybe you know of any other fractals you wish to be included in
  246.      the program.
  247.      Also if you think the program is great and I am a great guy,
  248.      please, drop me a letter and let me know.
  249.      ( It always feels good to get praised )
  250.      I will also try to answer letters to explain how these formulas work.
  251.  
  252.  
  253.  
  254. 1.  Short about the program.
  255.  
  256.     The program generates a number of fractals based on iterated
  257.     complex formulas.
  258.     Among these formulas I have included the very common used
  259.     "Mandelbrot" and "Julia" formulas, this is only an attempt to
  260.     cover all fractals based on iterated complex formulas.
  261.     Although these are the most commonly used fractals,
  262.     I prefer the transcendental functions s.a. Sine and Cosine.
  263.     I think lCOS(z) is the most fascinating fractal of this kind yet.
  264.     ( Therefore this is the default choice when choosing fractal )
  265.     The program is not very fast because it is written completely
  266.     in C, so if you know assembly language and know how to interface
  267.     assembly routines with a C program, please contact me and
  268.     I'll send you the source to the calculation formulas.
  269.     Important. Mathtrans.library MUST be on the disk you boot from,
  270.     otherwise the program will crash.
  271.  
  272.  
  273. 2.  If you are going to contact me.
  274.  
  275.     I will try to answer the mail as quick as possible, but I also
  276.     have a lot of studies to do, but I hope to be able to answer
  277.     any letters within a week ( or two ).
  278.  
  279.  
  280.  
  281. 3.  How to use the program.
  282.  
  283.     I hope you will find it very easy to use this program.
  284.     Here I will explain what the different menus and menuitems do.
  285.  
  286.     The First Menu:
  287.  
  288.     PROJECT      : This is what you want the program to do,
  289.                    all other menus are only to describe how and what
  290.                    to draw.
  291.  
  292.         ABOUT    : Opens a window to display my name.
  293.  
  294.         TITLE    : Toggles the titelbar on/off.
  295.  
  296.         START    : Starts drawing with the present options chosen
  297.                    on the other menus.
  298.  
  299.         COLOR    : Opens a window to manipulate the palette,
  300.                    ( I am quite proud of this one ).
  301.  
  302.         SAVE     : Saves the screen as an IFF-file,
  303.                    100% compatible with programs like Deluxe Paint and others.
  304.  
  305.         QUIT     : This one needs no explanation.
  306.  
  307.  
  308.     FRACTAL      : Choose which fractal to generate.
  309.  
  310.         MAND     : The ever so popular Mandelbrot.
  311.  
  312.         JULIA    : Generates a Julia picture.
  313.  
  314.         Ma&Ju.EXT  : Mandelbrot&Julia.Extended, You're gonna love this one.
  315.                    See later in this file for more info.
  316.  
  317.         LCOSZ    : lambda Cosine Z. I like this one.
  318.  
  319.         ESINZ    : ( 1 - epsilon i ) Sine Z.
  320.  
  321.         LEXPZ    : lambda Exponent Z.
  322.  
  323.         BIOMORPH : Generates a Biomorph.
  324.  
  325.         TYPE     : Which type of biomorph to generate.
  326.                    I.e. Which formula to use.
  327.  
  328.            Z3+C      : Z cube plus constant.
  329.  
  330.            Z5+C      : Z to power 5 plus constant.
  331.  
  332.            ZZ+Z5+C   : Z to power Z plus Z to power 5 plus constant.
  333.  
  334.            ZZ+Z6+C   : Z to power Z plus Z to power 6 plus constant.
  335.  
  336.            SINZ+Z2+C : Sine Z plus Z square plus constant.
  337.  
  338.            SINZ+EZ+C : Sine Z plus Exponent Z plus constant.
  339.  
  340.         NEWTON    : Using Newton-Raphsons method oh finding roots
  341.                     to a function.
  342.  
  343.         TYPE       : Which function to use.
  344.  
  345.            Z3-1    : Find the roots to the third degree function
  346.                      Z to power 3 minus 1,
  347.                      I.e. Solve Z3-1=0.
  348.  
  349.            Z4-1    : Z power 4 minus 1.
  350.  
  351.            Z5-1    : Z power 5 minus 1.
  352.  
  353.            Z5+Z3-1 : Z power 5 plus Z power 3 minus 1.
  354.                      ( This one is quite good )
  355.  
  356.         MAGNETISM  : Model for magnetism,
  357.                      The Renormalization transformation in terms of the
  358.                      "temperature" variable x=exp(J/kbT).
  359.  
  360.  
  361.     SCREEN         : What screen resolution to use.
  362.                      Important. When changing the screen,
  363.                      all palette information will be lost.
  364.  
  365.       LORES        : Make screen low resolution.
  366.  
  367.       HIRES        : Make screen high resolution.
  368.  
  369.       NOLACE       :
  370.                      Need these explanations?
  371.       LACE         :
  372.  
  373.    SURFACE         : What type of surface to generate fractal upon.
  374.  
  375.       D2RECT       : This is what you are used to.
  376.  
  377.       D3RECT       : Tries to make it 3-D.
  378.  
  379.       SPHERE       : Generates onto a sphere.
  380.  
  381.  
  382.     That's all, folks.
  383.  
  384.  
  385.  
  386. 4.  The second menubar.
  387.  
  388.     When drawing a picture, the ordinary menubar will be replaced by
  389.     a second one.
  390.     This menubar has only one menu : DRAWING...
  391.     with the three items TITLE, COLORS, STOP.
  392.     TITLE and COLORS are the same as usual,
  393.     and STOP only stops the drawing ( logical ehe? )
  394.     and returns to the ordinary menubar.
  395.  
  396.     Important. When you choose STOP the drawing will of course be
  397.     stopped, but it cannot be started again at the place of stopping.
  398.     START always starts with a blank screen.
  399.     ( Did that make sense )
  400.  
  401.  
  402. 5.  The Value Window.
  403.  
  404.     When choosing START a window will first be opened to get numerical
  405.     information about the picture,
  406.     when this information is given, and the window is closed
  407.     ( selecting OK ) the drawing will start.
  408.  
  409.     This window contains a number of string gadgets, where numbers
  410.     describing the picture will be displayed, and altered if
  411.     so is wished.
  412.     The number of gadgets/values is depending on which options are
  413.     chosen in the menus.
  414.  
  415.     These gadgets are always there:
  416.  
  417.     ReMin, ReMax:   The interval of the real value of the
  418.                     complex area displayed,
  419.                     from left to right of screen.
  420.  
  421.     ImMin, ImMax:   The interval of the imaginary value of the
  422.                     complex area displayed,
  423.                     from bottom to top of screen.
  424.  
  425.     ( If you are not familiar of complex numbers,
  426.       treat these values just as coordinates on a plane )
  427.  
  428.     MaxIter       : Maximum numbers of iterations to do on each
  429.                     pixel.
  430.                     A high value would give the picture a high consistent
  431.                     with reality, but would slow down the computer.
  432.  
  433.     There are a  lot of other gadgets that will be displayed, but
  434.     these are specific to the options chosen, and will be described
  435.     under the fractal that needs them, or the Surface algorithm that uses
  436.     them.
  437.  
  438.  
  439.  
  440. 6.  The Different types of fractals.
  441.  
  442.     MANDEL :
  443.  
  444.       Mandelbrot function.
  445.       The values of the series Z  is calculated :
  446.                2               n
  447.       Z   =  Z   + C.
  448.        n+1    n
  449.  
  450.       Where Z  = 0, and C is a complex constant representing the
  451.              0
  452.  
  453.       point that is to be investigated.
  454.       One calculates the speed of divergence,
  455.       i.e. how many iterations the formula needs for a specific point
  456.       to escape to infinity.
  457.       One has proved that if the absolute value of any Z in the serial
  458.       is greater than 4, then the serial will diverge towards
  459.       infinity, this is also true for the Julia function.
  460.       When one has detected divergency, the iteration is canceled
  461.       and the point is colored according to the speed of divergency it had,
  462.       i.e. the number of iterations needed to detect divergency.
  463.       If MaxIter number of iterations are made but no divergency is
  464.       detected the point will be colored black.
  465.       This does NOT mean that the serial converges, it does only tell us
  466.       that the serial does probably not diverge towards infinity.
  467.       The serial can just as well diverge towards a cycle of points with
  468.       absolute values less than 2.
  469.  
  470.       This is far the most known and popular fractal.
  471.  
  472.     JULIA :
  473.  
  474.       Julia is closely related to the mandelbrot function.
  475.       ( Same function but different start criteria )
  476.  
  477.       Here we choose Z the same way as we chose c in the mandelbrot
  478.                       0
  479.  
  480.       function, and uses the same constant for all the points that
  481.       we investigates.
  482.       This Constant is entered in the "Value Window" as ReConst and
  483.       ImConst.
  484.  
  485.       One thing that shows the very close relation between Mandelbrot
  486.       and Julia is that if the constant for Julia is chosen as a point
  487.       that comes from within the black area of the mandelbrot Set,
  488.       ( the black points that does not diverge towards infinity )
  489.       the julia set generated by this constant will also have a large
  490.       black area.
  491.       If the constant is chosen from outside of the Mandelbrot Set,
  492.       the Julia Set will not contain any black areas, but only an
  493.       infinitely number of nonconnected points distributed
  494.       over the complex plane.
  495.       Try to take points from the "edge" of the mandelbrot set,
  496.       these constants often makes the best julia sets.
  497.  
  498.  
  499.    Ma&Ju.EXT :
  500.  
  501.       Mandelbrot&Julia Extended. You're gonna love this one!
  502.       Have you not wanted to do fractals that no man has done before you?
  503.       And yourself choose which algorithms to use.
  504.  
  505.       First  you will have to give the program TWO constants,
  506.       C1 and C2,
  507.       Then the program asks for a string called RULES:
  508.       Here you can type a string of the rules you want the algorithm to
  509.       use.
  510.       These can be any combination of A, B, C, D and E.
  511.       Important. Only major characters allowed.
  512.  
  513.       Which are then these rules:
  514.  
  515.       A :  Zn+1 = Zn + Z0
  516.  
  517.       B :  Zn+1 = Zn + C1
  518.  
  519.       C :  Zn+1 = Zn + C2
  520.  
  521.       D :  Zn+1 = Zn2
  522.  
  523.       E :  Zn+1 = Zn2 + Zn/4
  524.  
  525.  
  526.      These rules are combined to tell the program how to iterate the
  527.      function.
  528.      E.g. If the rules are DA,
  529.      Then the first iterate is to square Z, and the second iterate would
  530.      be to add the local constant Z0, ( the point that is investigated ),
  531.      to Z.
  532.      When both these operations have been done, then the iteration counter
  533.      will be incremented and the rules will be repeated  on and on ...
  534.      I.e DA is equivalent to the serial DADADADADADA......
  535.      which is the same as generating a mandelbrot figure.
  536.      In the same way DB or DC would generate Julia pictures, with the
  537.      constant in C1 or C2.
  538.      Note. MaxIter is not the maximum number of operations to do ,
  539.      but the maximum number of times to run through the string of rules.
  540.  
  541.  
  542.  
  543.    LCOSZ :
  544.  
  545.     lambda COS (Z) .
  546.  
  547.     This is my favorite.
  548.  
  549.     Lambda should be in the interval ( -3.14, -2.92 )
  550.     When lambda is greater than 2.96 there will be a large black deformed
  551.     circle centered around ...  -PI 0 PI 2PI 3 PI ... on the real axis.
  552.     But when lambda falls below 2.96 the fractal explodes and no black
  553.     regions will survive the explosion.
  554.  
  555.     Test to draw a couple of pictures for lambda between -3.14 and -2.92
  556.     and you will see what I mean.
  557.  
  558.  
  559.    ESINZ :
  560.  
  561.     (1-epsilon i ) SIN (Z).
  562.  
  563.     Quite fascinating and very beautiful.
  564.     Let epsilon be in the interval 0.1 to 0.4.
  565.  
  566.     Draw it, You'll like it.
  567.  
  568.  
  569.    LEXPZ :
  570.  
  571.     Lambda Exponent Z.
  572.  
  573.     I have made only very few pictures with this formula, so I do not
  574.     have much to write about it.
  575.  
  576.  
  577.    BIOMORPH :
  578.  
  579.     The same principle as Julia pictures, but different formulas and a
  580.     slightly different way to choose if to paint pixel.
  581.     6 different types of formulas.
  582.     These are very suitable to draw with D3-RECT.
  583.  
  584.    NEWTON :
  585.  
  586.     The Newton-Raphson method of finding roots to a function.
  587.     Of course I have included the very popular Z3-1=0 equation,
  588.     but try Z5+Z3-1=0, that's really something.
  589.  
  590.    MAGNETISM :
  591.  
  592.     Model of magnetism.
  593.     The Renormalization transform in terms of the "temperature" variable
  594.     x=exp(J/kbT).
  595.     This one I found in " The Beauty of Fractals" p 129 and forw.
  596.  
  597.     Try Re = [ -6, 6 ]
  598.         Im = [ -6, 6 ]
  599.         C  = ( 4, 0 )
  600.  
  601.  
  602.  
  603.  
  604. 7.  REFERENCES.
  605.  
  606.     You don't have to bother with these books if you just want to make
  607.     pictures, I hope the program is easy enough to use without
  608.     having to read a lot of books.
  609.  
  610.     The Beauty Of Fractals, H.O.Peitgen P.H.Richter,
  611.       Springer Verlag 1986.
  612.       A very fine book with many very beautiful pictures,
  613.       but the text is often very advanced, this is nothing
  614.       that you can read and understand without at least 1.5 -2
  615.       years of math studies at university level.
  616.       But the pictures are GREAT.
  617.  
  618.     The Science of Fractal Images, H.O.Peitgen ( don't remember  the other guy )
  619.       Springer Verlag 198?.
  620.       This book is almost the same as the previous, but now they have
  621.       skipped almost all the mathematical formulas and theory and
  622.       replaced it with pseudocode to generate the pictures.
  623.       There are a few more fractals in this book.
  624.       If you want code and an easy to understand book, buy this one.
  625.       If you want theory and mathematical proofs, buy the other one.
  626.  
  627.     The Fractal Geometry of Nature, B.B.Mandelbrot,
  628.       International Business Machines
  629.       Thomas J. Watson Research Center
  630.       W.H.Freeman and Company, New York 1977.
  631.       This book is written by the master himself.
  632.       Very advanced.
  633.  
  634.     BIOMORPHS: Computer Display of Biological Forms Generated by
  635.                Mathematical Feedback Loops.
  636.     C.A.Pickover,
  637.     Computer Graphics Forum vol 5 1986
  638.     ( can be found at almost any university library )
  639.  
  640.  
  641.  
  642.     This was all for this time.
  643.  
  644.  
  645.  
  646. ADDITIONS:
  647.  
  648. Models for Magnetism
  649.  
  650. In "BoF" there are two different models used for magnetism.
  651. Each of these have two different mappings, x- and q-mapping.
  652. The X-mapping ( variabel mapping ) is what corresponds to the all famous
  653. Julia function.
  654. ( i.e. The Julia function is the variabel mapping of the square function
  655.   x=x^2+c )
  656. The Q-mapping ( parameter mapping ) is what corresponds to the
  657. Mandelbrot function.
  658. ( i.e. The Mandelbrot function is the parameter mapping of the square
  659. function. )
  660.  
  661. So, Magnet q1 would then be the parameter mapping of model 1.
  662. And, in the same way, Magnet x2 would then be the var. mapping of model 2.
  663.  
  664. ( quoting the Bof )
  665. Two hierachical lattices with Potts spins are analyzed. The renormalization
  666. transform in terms of the "temperature" variable x=exp(J/kbT) reads
  667.  
  668.        (  2     ) 2
  669.        | x +q-1 |
  670. x |->  | ------ |                         ( MODEL 1 )
  671.        ( 2x+q-2 )
  672.  
  673.  
  674.  
  675.        (  3                    ) 2
  676.        | x +3(q-1)x+(q-1)(q-2) |
  677. x |->  | ----------------------|          ( MODEL 2 )
  678.        |   2          2        |
  679.        ( 3x +3(q-2)x+q -3q+3   )
  680.  
  681.  
  682. where q is the number of Potts states in the original model but is treated
  683. as a complex parameter here.
  684.  
  685. End of Magnet addition.
  686.  
  687.  
  688.  
  689. STRANGE ATTRACTOR.
  690.    A strange attractor is a very,very,very complex mathematical object.
  691.    To make it short:
  692.       An iterated formulas can behave in some different ways.
  693.       First, Fixpoint iteration, the iteration is attracted by a fix point,
  694.       that might be zero 3.65 or, why not, infinity.
  695.       That is when you give that specific number as input to the iteration,
  696.       you'll get the same number as output.
  697.  
  698.       Second, Periodic Cycle. the iteration is attracted by a periodic
  699.       cycle.
  700.  
  701.       And the third one, Strange Attractors.
  702.       The iteration is attracted by something, but we do not know exactly
  703.       what it is.
  704.       One of it's features is global convergens, but local divergence.
  705.       ( Did that make sense ? )
  706.       Lorentz attractor is a well known example.
  707.       Search your local library for books about attractors if you want to
  708.       know more about it.
  709.       I don't have any particular book to recomend.
  710.  
  711.  
  712.       STRANGE ATTRACTOR in this program is based on an article by
  713.       Clifford A Pickover.
  714.  
  715.       Computer & Graphics vol 12 no 2 pp 263-267,1988
  716.       A note on rendering 3-d strange attractors
  717.       Clifford A Pickover.
  718.  
  719.       The iteration is in R3 eucledian space.
  720.       X |        (   sin(a*y) - z*cos(b*s) )
  721.       Y |    =>  | z*sin(c*x) -   cos(d*y) |
  722.       Z |        ( e*sin(x)                )
  723.          n+1
  724.                           T
  725.       It starts in (0,0,0)   and has five parameters a,b,c,d and e.
  726.  
  727.       It will automatically adjust the width and height parameters so that
  728.       the attractor never will come outside the border of the screen.
  729.  
  730. Just press ok. and wait and watch.
  731. It takes from 30 min to 1 h to generate the picture.
  732. First it will only look like some randomly distributed points on to the screen,
  733. but after a while it will take a more solid form.
  734.  
  735. OBS No maxiter is asked for.
  736. When you think the picture is finished, press stop.
  737. ( But let it at least run for 30 min . )
  738.  
  739. End of Strange Attractor.
  740.  
  741.  
  742. CYCLIC SYSTEMS:
  743.  
  744. Computers & Graphics vol 11 no 2 pp 217-226, 1987
  745. Mathematics and Beauty:
  746. Time-Discrete Phase Planes Associated With the Cyclic System,
  747. Clifford A Pickover.
  748.  
  749. Look in the article for further details. ( I hate writing docs and tries to
  750. make it as short as possible. )
  751. The six different systems are
  752. 0 : f = Sin( x + Sin( px ) )
  753.  
  754.               2
  755. 1 : f = Sin( x + Sin( px ) )
  756.  
  757. 2 : f = Sin( x + Tan( px ) )
  758.  
  759. 3 : f = Sin( x + Sin( x )Sin( px ) )
  760.  
  761. 4 : f = Sin( x + Cos( px ) )
  762.  
  763.  
  764.          ( Sin( x )              : |x| < PI
  765.          |
  766.          |       2
  767. 5 : f =  | Sin( x + Sin( px ) )  : PI =< |x| =< 2PI
  768.          |
  769.          |             2
  770.          ( Sin( x + Sin ( px ) ) : |x| > 2PI
  771.  
  772. Short:
  773. We look at a system of two differential equations :
  774.  
  775. x'(t) = -f(y(t))  and
  776.  
  777. y'(t) =  f(x(t)) .
  778.  
  779. We calculate approximations of the d.e using the forward Euler
  780. approximation.
  781. If you have studied some Numerical Analysis, you'll know what it is.
  782.  
  783. Enough of this, try them out and you'll know how they work.
  784.  
  785. OOPS, in getvalue window res how many increments that will be use on each
  786. axix.
  787. res = 50, split the x-axis in 50 parts,and the y-axis in 50 parts.
  788. that makes 2500 parts ( 50*50 ).
  789. Each of these points will be used as a starting point for the approximation
  790. and the iter succeding points of each starting point will be plotted.
  791. h is what walue of h that will be used.
  792.  
  793.  
  794. END CYCLIC SYSTEM
  795.  
  796.  
  797.  
  798. ULTIMATE
  799. The general purpose fractal generator.
  800. This is version 2.1 of the program, and is probably the last version
  801. ever, atleast that I write.
  802. ( I'm quite feed up with this program now. )
  803. I have removed Mandelbrot & Julia Extended and replaced it with
  804. this one instead.
  805.  
  806. With this option you can generate almost any possible fractal.
  807.  
  808. How to use it.
  809.  
  810. First one must type the Iteration Formula,
  811. This is done by writing an appropriate text string in the text gadget.
  812. 110 characters are the maximum lenght of this string.
  813. The default formula is the one that generates the mandelbrot set.
  814. This formula describes how to calculate
  815.  
  816. Z     =  f ( Z  ) .
  817.  n+1          n
  818.  
  819. I.e. it describes the complex-valued function f .
  820.  
  821.  
  822. The formula uses an "register" to calculate the iteration,
  823. and most of the operations work directly on this register.
  824.  
  825.  
  826. At the start of the iteration, the register will automatically be
  827. set to 0.
  828.  
  829. (The Mandelbrot default )
  830. KFAq
  831.  
  832.     At the start of the iteration the register will be set to 0.
  833. K : +Zn   , add the previous value of Z to the register.
  834. F : ^2    , square the register.
  835. A : +Z0   , add start value of iteration to register.
  836. q : Z >   , check if the norm of Z escapes towards infinity.
  837.             If the Norm ( distance to origo ) of the number Zn
  838.             is greater than the value of Z > , this will break
  839.             the iteration.
  840.  
  841. As , I hope , all of you already have seen, this is simply the formula
  842. to generate the mandelbrot set.
  843.  
  844.  
  845. To help writing the formulas, I have included many different operations,
  846. ten different constants, ten memory variables and four different ways
  847. of checking if to abort the iteration.
  848.  
  849.  
  850. The first five operates Z0 on the register.
  851. Z0 is the starting value of the iteration.
  852.  
  853. A , +Z0  : Add contents of Z0 to register.
  854. B , -Z0  : Subtract contents of Z0 to register.
  855. C , *Z0  : Multiply register with Z0.
  856. D , /Z0  : Divide register with Z0.
  857. E , ^Z0  : Power Z0 of register.
  858.  
  859.  
  860. The next five takes some standard powers of the register.
  861.  
  862. F ,  ^2  : Square register.
  863. G ,  ^3  : Cube register.
  864. H ,  ^4  : Take power 4 of register.
  865. I ,  ^5  : Take power 5 of register.
  866. J ,  ^6  : Take power 6 of register.
  867.  
  868. The next five operates Zn on the register.
  869. Zn is the previous value of the serie Z,
  870. Is used when calculating Zn+1.
  871. NOTE if you don't use at least one of the following in your iteration formula
  872. I bet that the result will not be extremely interesting.
  873.  
  874. K , +Zn  : Add Zn to the register.
  875. L , -Zn  : Subtract Zn from the register.
  876. M , *Zn  : Multiply Zn to the register.
  877. N , /Zn  : Divides register with Zn.
  878. O , ^Zn  : Takes power Zn of register.
  879.  
  880. The next five is some useful trancendental functions.
  881.  
  882. P , ln   : Takes logaritm function of register. ( Base e )
  883. Q , exp  : Exponential function of the register.
  884. R , sin  : Sine function of the register.
  885. S , cos  : Cosine function of the register.
  886. T , tan  : Tanget function of the register.
  887.  
  888. The next five operations, operate the constants on the register.
  889. These are Two-Character-Operations, which means that one also must
  890. tell wich constant to use.
  891. x is an integer 0,1, ... ,9 telling the computer wich constant to use.
  892. Ex. a3 means add constant 3 to register.
  893.  
  894. ax , +Cx : Adds constant x to register.
  895. bx , -Cx : Subtracts constant x from register.
  896. cx , *Cx : Multiplies constant x to register.
  897. dx , /Cx : Divides register with constant x.
  898. ex , ^Cx : Takes the register to power constant x.
  899.  
  900. The next four are to tell the computer how to check if to abort the
  901. iteration.
  902. The pixels are colored according to the number of iterations it takes
  903. to discover divergens.
  904. If maxiter number of iterations were made without discovering divergens,
  905. the pixel will not be colored at all.
  906. If you do not use at least one of the following in your formula,
  907. the program will NEVER detect divergens and will therefore not
  908. color any pixel at all.
  909. The value of Z is assumed to be in the register.
  910. The abortion of the iteration is not made until the end of the formula,
  911. so it is possible to combine two or more of the operations.
  912. Ex. hi will make both the checks before aborting the iteration,
  913. even if the h check tells the program to abort.
  914. ghi gives almost the same result as the biomorphs do.
  915. j is useful when checking convergens, as in the newton-raphson method.
  916.  
  917. I suggest that these checkings are made at the end of the formula.
  918.  
  919. g , Z >  : If the Norm of Z is greater than the limit value of Z >,
  920.            then the iteration will be aborted, and the pixel will
  921.            be colored according to how many iterations it took to
  922.            reach this limit.
  923.            ( Standard divergens check )
  924. h , Re>  : If the real part of Z is it greater than the limit value of Re>
  925.            then the iteration will be aborted, and the pixel colored.
  926.            The color will also be slightly different than in the g check.
  927. i , Im>  : The same as h, but works with the imaginary part of Z instead.
  928.            The color will be slightly different than in the g ani h case.
  929. j , dZ<  : Checks if the difference between Z and Zn is less tan the
  930.            limit value of dZ<,and if so the iteration will be aborted.
  931.  
  932. The next 8 operations work with the ten different memory variables.
  933. In these variables it is possible to store temporary results in the formula.
  934. As the operations of the constants, these are also
  935. Two-Character-Operations.
  936.  
  937. kx , +Tx  : Adds temporary variable x to register.
  938. lx , -Tx  : Subtracts temporary variable x from register.
  939. mx , *Tx  : Multiplies temporary variable x to register.
  940. nx , /Tx  : Divides register with temporary variable x.
  941. ox , ^Tx  : Takes register to power of temporary variable x.
  942. px , ->Tx : Copies register to temporary variable x.
  943. qx , <-Tx : Copies temporary variable x to register.
  944. rx , <>Tx : Swaps temporary variable x and register.
  945.  
  946. The last two operations:
  947.  
  948. s ,  = 0  : Sets register to 0,
  949.             Useful after using px.
  950. t ,  INV  : Inverts the register.
  951.  
  952.  
  953.  
  954. Real and Imaginary max and min is the same as before.
  955.  
  956. There are ten different constants 0-9 to use.
  957.  
  958. There are four different escape limits.
  959. Z > , Re> , Im> , these work with operations g h i respectively,
  960.   and checks if the norm of Z is greater than these limit values.
  961. dZ< , this one works with operation j , and checks if the difference
  962.   between two succeding values of Z is less than the limit.
  963.  
  964.  
  965.  
  966. HINTS,
  967. The operations does not include all functions but most others can be obtained
  968. by using combinations of the others.
  969.  
  970. This is how they are related:
  971. ( z=a+bi is a complex number, a and b are real )
  972.  
  973. Exp(z) =  Exp(a)*( Cos(b) + Sin(b)i )
  974. Ln(z) is the inverse function of Exp.
  975.  ( it is quite tricky to calculate ln of a complex number, so it is more
  976.    time consuming than the other functions. )
  977.  
  978.              zi    -zi
  979.             e   - e
  980. Sin(z) =  ------------  = sin(a)*cosh(b) + i*cos(a)*sinh(b)
  981.                2i
  982.  
  983.  
  984.              zi    -zi
  985.             e   + e
  986. Cos(z) =  ------------  = cos(a)*cosh(b) - i*sin(a)*sinh(b)
  987.                 2
  988.  
  989.  
  990. Tan(z) = Sin(z) / Cos(z) .
  991.  
  992. ( These were included )
  993.  
  994. ArcSin(z) = -i*ln( z*i +/- Sqrt( 1-z*z ) ) .
  995.  
  996. ArcCos(z) = -i*ln( z   +/- i*Sqrt( 1-z*z ) ) .
  997.  
  998. ArcTan(z) = i/2*ln( (i+z)/(i-z) )
  999. ( As you see, these functions are multivalued, so use the one you choose. )
  1000.  
  1001.  
  1002.  
  1003. Sinhyp(z) = -i*Sin( -z*i )      ( =  (Exp(z)+Exp(-z))/2  )
  1004.  
  1005. Coshyp(z) = Cos( -z*i )
  1006.  
  1007. Tanhyp(z) = Sinhyp(z)/Coshyp(z)
  1008.  
  1009. ArcSinhyp(z) = ln( z +/- Sqrt( z*z+1 ) )
  1010.  
  1011. ArcCoshyp(z) = ln( z +/- Sqrt( z*z-1 ) )
  1012.  
  1013. ArcTanhyp(z) = 1/2*ln( (1+z)/(1-z) )
  1014.  
  1015.  
  1016. Also notice that the complex powerfunction is NOT continous around the
  1017. negative part of the real-axis.
  1018. Therefore it is not very surprising if the picture looks odd, around
  1019. the real-axis when using operations E or O.
  1020. I.e. The self powered function Z^Z will not look like the ones in the
  1021. biomorph section.
  1022. When using biomorphs I did not use the true Z^Z function, but
  1023. Z^(a+|b|i) instead, when this would give a continous function.
  1024.  
  1025. KFAq  is mandelbrot function.
  1026. KFa0q is Julia function with constant number 0 .
  1027.  
  1028. KFm0jf0iKGm1k2c0t  with ( 3 , 0 ) as constant 0 ,
  1029.                         ( 2 , 0 ) as constant 1 ,
  1030.                         ( 1 , 0 ) as constant 2 ,
  1031.                     would generate the Newton-Raphson mapping for the function
  1032.                     Z3-1 = 0.
  1033.  
  1034.  
  1035. Have Fun.
  1036. End of Ultimate.
  1037.  
  1038.  
  1039.  
  1040.