home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Extra 1996 #6 / AmigaPlus-eXtra-6-96.iso.7z / AmigaPlus-eXtra-6-96.iso / programme / dust / batchfiles / plotfunction.bat < prev    next >
DOS Batch File  |  1996-03-22  |  592b  |  42 lines

  1. ;This script creates a plane and applies the function sin(x^2+y^2) to it
  2. ;init
  3.  
  4. ;parameters
  5. .buffer=2
  6. .xmin:=-50
  7. .xmax:=50
  8. .ymin:=-50
  9. .ymax:=50
  10. .z:=0
  11. .xsect:=10
  12. .ysect:=10
  13.  
  14.  
  15. ;doit
  16. .xstep=(xmax-xmin)/(xsect-1)
  17. .ystep=(ymax-ymin)/(ysect-1)
  18.  
  19. for(i,0,xsect-2)
  20.  .x1=xmin+i*xstep
  21.  .x2=x1+xstep
  22.  for(j,0,ysect-2)
  23.   .y1=ymin+j*ystep
  24.   .y2=y1+ystep
  25.   addface(buffer,x1,y1,z,x2,y1,z,x2,y2,z)
  26.   addface(buffer,x1,y1,z,x1,y2,z,x2,y2,z)
  27.  end
  28. end
  29.  
  30. merge(buffer)
  31.  
  32. ;show the result
  33. set(rotx,138)
  34. set(rotz,330)
  35. set(zoom,1.2)
  36. window(buffer)
  37.  
  38. ;plot the function
  39. func(2,30*sin((x0*x0+y0*y0)/25),0,z)
  40.  
  41. showvalues
  42.