home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / grafx.zip / LINES.FOR < prev    next >
Text File  |  1989-03-14  |  1KB  |  40 lines

  1. c    program main
  2. c    call gset                            !  enter graphic mode
  3. c    call lines
  4. c    call aset                            !  return to alpha mode
  5. c    end    
  6. c    -----------------------------------------------------------------------
  7.     subroutine lines
  8. c
  9. c    ...demonstrate GRAFX line modes
  10. c
  11. c    (C) Copyright 1988, 1989 by Jim Farrell      All Rights Reserved.
  12. c
  13.     parameter(n=512)
  14.     parameter(xmax=100,xmin=-xmax)
  15. c
  16.     external fcn                        !  function to plot
  17. c    
  18.     call putstr(10,20,' DEMONSTRATION OF GRAFX LINE MODES')
  19.     call putstr(12,20,'      USING f(x) = 2 * x * sin(x/3)')
  20.     call pause('WHEN READY ')            !  display message and pause
  21.     call gcls                            !  clear graphic screen
  22.     do 300 ip=0,4
  23.         call gcls                        !  clear graphic screen
  24.         call fcnplt(xmin,xmax,fcn,n,0,ip)    !  plot a function
  25.         if(ip.eq.0)call pause('0 - DISCRETE POINTS X,Y')
  26.         if(ip.eq.1)call pause('1 - LINE FROM X,Y-MINIMUM TO X,Y')
  27.         if(ip.eq.2)call pause('2 - LINE FROM X,0 TO X,Y')
  28.         if(ip.eq.3)call pause('3 - RADIAL LINE FROM 0,0 TO X,Y')
  29.         if(ip.eq.4)call pause('4 - CONNECTED LINE')
  30. 300    continue
  31.     return
  32.     end
  33. c    ------------------------------------------------------------------
  34.     function fcn(x)
  35. c
  36. c    ...function to generate curve
  37. c
  38.     fcn=2.0*x*sin(x/3.0)
  39.     return
  40.     end