home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / util / 3d_plot_.sit / PlotData.bas < prev   
BASIC Source File  |  1986-04-25  |  565b  |  34 lines

  1. INPUT "What do you want to call the output file? ",f$
  2.  
  3. INPUT "Input the x-range (low,high)? ",xl,xh
  4. xl = INT(xl)
  5. xh = INT(xh)
  6.  
  7. INPUT "Input the y-range (low,high)? ",yl,yh
  8. yl = INT(yl)
  9. yh = INT(yh)
  10.  
  11. INPUT "How many x points? ",m
  12. INPUT "How many y points? ",n
  13.  
  14. OPEN f$ FOR OUTPUT AS #1
  15.  
  16. PRINT #1,m
  17. PRINT #1,n
  18. PRINT #1,xl
  19. PRINT #1,xh
  20. PRINT #1,yl
  21. PRINT #1,yh
  22.  
  23. FOR i = 0 TO m-1
  24.     FOR j  = 0 TO n-1
  25.         x = xl+(xh - xl)/m * i
  26.         y = yl+(yh - yl)/n * j
  27.         z = SIN(x*y)      'Replace this with your function
  28.         PRINT #1,z
  29.     NEXT j
  30. NEXT i
  31.  
  32. CLOSE #1
  33.  
  34.