home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!think.com!samsung!munnari.oz.au!news.hawaii.edu!jach.hawaii.edu!JOEL
- From: joel@jach.hawaii.edu
- Newsgroups: vmsnet.sources.games
- Subject: MANDELBROT source
- Message-ID: <1992Jan4.061137.14200@news.Hawaii.Edu>
- Date: 4 Jan 92 06:11:37 GMT
- Sender: root@news.Hawaii.Edu (News Service)
- Reply-To: joel@jach.hawaii.edu
- Organization: UK/Canada/Netherlands Joint Astronomy Centre, Hilo, HI
- Lines: 73
- Nntp-Posting-Host: maikai.jach.hawaii.edu
-
- c MANDELBROT in VAX/VMS Fortran/PGPLOT, output to Tek 4014
- c
- c Dec '91 Joel Aycock (JOEL@JACH.HAWAII.EDU)
- c UK Infrared Telescope
- c Joint Astronomy Centre, Hawaii
-
- c must be linked with PGPLOT library: GRPSHR.OLB
-
- integer iter
- real r,i,rstart,rend,istart,iend,size,step
- real pistart,piend
- real*16 r16,i16,zr,zi,newzr,newzi
-
- write (5,10)
- 10 format (//'$ start (real,imaginary) ')
- read (5,*) rstart,istart
-
- write (5,15)
- 15 format (//'$ extent, step size ')
- read (5,*) size,step
-
- rend = rstart + size
- iend = istart + size
-
- pistart = istart
- piend = iend
-
- write (5,20)
- 20 format (//'$ iterations ')
- read (5,*) iter
-
- if ((istart.lt.0.).and.(iend.gt.0.)) then
- if (abs(istart).gt.iend) then
- iend=0.
- else
- istart=0.
- endif
- endif
-
- type *,char(27),'[?38h'
-
- call pgbegin(0,'TEK',1,1)
- call pgenv(rstart,rend,pistart,piend,0,1)
-
- do r=rstart,rend,step
- do i=istart,iend,step
- r16=r
- i16=i
- zr=0.
- zi=0.
- do n=1,iter
- newzr = zr*zr-zi*zi+r16
- newzi = 2.*zr*zi+i16
- if ((newzr.eq.zr).and.(newzi.eq.zi)) goto 100
- zr = newzr
- zi = newzi
- if ((zr*zr+zi*zi).gt.4.) goto 200
- enddo
-
- 100 call pgpoint(1,r,i,-1)
- call pgpoint(1,r,-i,-1)
-
- 200 enddo
- enddo
-
- call pgend
-
- read (5,900) test
- type *,char(27),'[?38l'
- 900 format (a1)
-
- stop
- end
-