home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d958 / fed-case.lha / Fed-CASE / sources / chaos.c next >
C/C++ Source or Header  |  1993-12-04  |  4KB  |  91 lines

  1. /************************************************************************/
  2. /*                                                                      */
  3. /*         Code generated by FED-CASE V1.0  Code Generator              */
  4. /*                  © Joosen Software Development                       */
  5. /*                    All rights reserved 1993                          */
  6. /*                                                                      */
  7. /************************************************************************/
  8.  
  9. /************************************************************************/
  10. /*                                                                      */
  11. /*                          Start of Includes                           */
  12. /*                                                                      */
  13. /************************************************************************/
  14.  
  15. #include <exec/types.h>
  16. #include <data/const_chaos.h>
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19.  
  20. /************************************************************************/
  21. /*                                                                      */
  22. /*                           End of Includes                            */
  23. /*                                                                      */
  24. /************************************************************************/
  25.  
  26. /************************************************************************/
  27. /*                                                                      */
  28. /*                    Start of source prototype file                    */
  29. /*                                                                      */
  30. /************************************************************************/
  31.  
  32. #include <proto/proto_chaos.h>
  33.  
  34. /************************************************************************/
  35. /*                                                                      */
  36. /*                     End of source prototype file                     */
  37. /*                                                                      */
  38. /************************************************************************/
  39.  
  40.  
  41. /************************************************************************/
  42. /* Procedure  : void V_chaos(FF_X,FF_k)                                 */
  43. /* Function   :                                                         */
  44. /* Designer   : C.Joosen & R.Heijmans                                   */
  45. /* Date       : Sat Nov 27 13:40:15 1993                                */
  46. /*                                                                      */
  47. /* Modificat  :                                                         */
  48. /* Handler    :                                                         */
  49. /* Modific.   :                                                         */
  50. /*                                                                      */
  51. /************************************************************************/
  52.  
  53. void V_chaos(FF_X,FF_k)
  54. float FF_X;
  55. float FF_k;
  56. {
  57. float LF_Xold;
  58. float LF_Xnew;
  59. int LI_count;
  60. float LF_eps;
  61.  
  62.     LF_eps= 0.00001 ;
  63.     LI_count= 0;
  64.     do
  65.     {
  66.         LF_Xnew= FF_k* FF_X* ((float)1 - FF_X);
  67.         LF_Xold= FF_X;
  68.         FF_X= LF_Xnew;
  69.         LI_count++;
  70.     } while( abs((int) LF_Xnew - (int)LF_Xold ) > LF_eps);    /* abs:  */
  71.     printf( "%d iteraties\n" , LI_count );            /* printf: Standard output function */
  72. }                                /* end of V_chaos */
  73.  
  74. /************************************************************************/
  75. /* Procedure  : void main()                                             */
  76. /* Function   :                                                         */
  77. /* Designer   : C.Joosen & R.Heijmans                                   */
  78. /* Date       : Sat Nov 27 13:40:19 1993                                */
  79. /*                                                                      */
  80. /* Modificat  :                                                         */
  81. /* Handler    :                                                         */
  82. /* Modific.   :                                                         */
  83. /*                                                                      */
  84. /************************************************************************/
  85.  
  86. void main()
  87. {
  88.  
  89.     V_chaos( (float) 22 , (float) 115 );
  90. }                                /* end of V_main */
  91.