home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / games / new / 920104.1 < prev    next >
Encoding:
Internet Message Format  |  1992-01-03  |  1.8 KB

  1. Path: uunet!think.com!samsung!munnari.oz.au!news.hawaii.edu!jach.hawaii.edu!JOEL
  2. From: joel@jach.hawaii.edu
  3. Newsgroups: vmsnet.sources.games
  4. Subject: MANDELFAST source
  5. Message-ID: <1992Jan4.061219.14297@news.Hawaii.Edu>
  6. Date: 4 Jan 92 06:12:19 GMT
  7. Sender: root@news.Hawaii.Edu (News Service)
  8. Reply-To: joel@jach.hawaii.edu
  9. Organization: UK/Canada/Netherlands Joint Astronomy Centre, Hilo, HI
  10. Lines: 75
  11. Nntp-Posting-Host: maikai.jach.hawaii.edu
  12.  
  13. c    MANDELBROT in VAX/VMS Fortran/PGPLOT, output to Tek 4014
  14. c
  15. c        MANDELFAST: REAL*8 variables for speed
  16. c
  17. c    Dec '91        Joel Aycock (JOEL@JACH.HAWAII.EDU)
  18. c            UK Infrared Telescope
  19. c            Joint Astronomy Centre, Hawaii
  20.  
  21. c        must be linked with PGPLOT library: GRPSHR.OLB
  22.  
  23.     integer    iter
  24.     real    r,i,rstart,rend,istart,iend,size,step
  25.     real    pistart,piend
  26.     real    r16,i16,zr,zi,newzr,newzi
  27.  
  28.     write (5,10)
  29. 10    format (//'$   start (real,imaginary) ')
  30.     read (5,*) rstart,istart
  31.  
  32.     write (5,15)
  33. 15    format (//'$        extent, step size ')
  34.     read (5,*) size,step
  35.  
  36.     rend = rstart + size
  37.     iend = istart + size
  38.  
  39.     pistart = istart
  40.     piend   = iend
  41.  
  42.     write (5,20)
  43. 20    format (//'$               iterations ')
  44.     read (5,*) iter
  45.  
  46.     if ((istart.lt.0.).and.(iend.gt.0.)) then
  47.         if (abs(istart).gt.iend) then
  48.             iend=0.
  49.           else
  50.             istart=0.
  51.         endif
  52.     endif
  53.  
  54.     type *,char(27),'[?38h'
  55.  
  56.     call pgbegin(0,'TEK',1,1)
  57.     call pgenv(rstart,rend,pistart,piend,0,1)
  58.  
  59.     do r=rstart,rend,step
  60.         do i=istart,iend,step
  61.           r16=r
  62.           i16=i
  63.           zr=0.
  64.           zi=0.
  65.           do n=1,iter
  66.             newzr = zr*zr-zi*zi+r16
  67.             newzi = 2.*zr*zi+i16
  68.             if ((newzr.eq.zr).and.(newzi.eq.zi)) goto 100
  69.             zr = newzr
  70.             zi = newzi
  71.             if ((zr*zr+zi*zi).gt.4.) goto 200
  72.           enddo
  73.  
  74. 100          call pgpoint(1,r,i,-1)
  75.           call pgpoint(1,r,-i,-1)
  76.  
  77. 200        enddo
  78.     enddo
  79.  
  80.     call pgend
  81.  
  82.     read (5,900) test
  83.     type *,char(27),'[?38l'
  84. 900    format (a1)
  85.  
  86.     stop
  87.     end
  88.