home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1986 February / 64er_Magazin_86-02_1986_Markt__Technik_de.d64 / demo_mps-support (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  84 lines

  1. 1000 rem graph-64 demo
  2. 1010 input "demo 1,2,3 oder 4";de
  3. 1020 _clear:_colour 1,5,7
  4. 1030 on de gosub 2000,3000,4000,5000
  5. 1040 _zoom:_graphic
  6. 1050 end
  7. 1999 :
  8. 2000 rem demo 1
  9. 2010 for i=-(NULL)/4 to (NULL)/4 step (NULL)/15
  10. 2020 for j=0 to 2*(NULL) step (NULL)/15
  11. 2030 _line cos(i)*319+320,sin(i)*199+200,cos(j)*319+320,sin(j)*199+200
  12. 2040 next j,i
  13. 2050 return
  14. 2999 :
  15. 3000 rem demo 2
  16. 3010 for i=0 to 2*(NULL) step (NULL)/50
  17. 3020 _line cos(i)*50+320,sin(i)*50+200,sqr(i/(2*(NULL)))*639,i/(2*(NULL))*399
  18. 3030 next
  19. 3040 return
  20. 3999 :
  21. 4000 rem demo 3
  22. 4010 _poly 2,2,637,2,637,397,2,397
  23. 4020 _line 10,200,630,200
  24. 4030 _line 320,10,320,390
  25. 4040 _line 320,10,316,15
  26. 4050 _line 320,10,324,15
  27. 4060 _line 630,200,626,205
  28. 4070 _line 630,200,626,195
  29. 4080 for i=10+620/32 to 630-620/32 step 620/32
  30. 4090 _line i,196,i,204:next
  31. 4100 for i=10+380/40 to 390-380/40 step 380/40
  32. 4110 _line 316,i,324,i:next
  33. 4120 _char 42,26,asc("[255]")
  34. 4130 _char 38,13,asc("1")
  35. 4140 _char 78,26,asc("x")
  36. 4150 xc=35:yc=1:a$="f(x)":gosub 6000
  37. 4160 xc=6:yc=5:a$="f(x)=sin(x)+sin(x*1.1)":gosub 6000
  38. 4170 _poly 44,36,228,36,228,50,44,50
  39. 4180 def fns(x)=sin(x)+sin(x*1.1)
  40. 4190 y1=fns((0-310)/310*16*(NULL))*(-95)+200
  41. 4200 for i=1 to 620
  42. 4210 y2=fns((i-310)/310*16*(NULL))*(-95)+200
  43. 4220 _line i+9,y1,i+10,y2
  44. 4230 y1=y2
  45. 4240 next
  46. 4250 return
  47. 4999 :
  48. 5000 rem demo 4
  49. 5010 dim x1%(68),x2%(68),z1%(68),z2%(68)
  50. 5020 co=cos((NULL)/9):si=sin((NULL)/9)
  51. 5030 y=-168
  52. 5040 for x=-272 to 272 step 8
  53. 5050 gosub 5240
  54. 5060 x1%(x/8+34)=xp:z1%(x/8+34)=zp
  55. 5070 next
  56. 5080 for y=-160 to 168 step 8
  57. 5090 for x=-272 to 272 step 8
  58. 5100 gosub 5240
  59. 5110 x2%(x/8+34)=xp:z2%(x/8+34)=zp
  60. 5120 next
  61. 5130 for i=0 to 67
  62. 5140 _epoly x1%(i),z1%(i),x1%(i+1),z1%(i+1),x2%(i+1),z2%(i+1),x2%(i),z2%(i)
  63. 5150 _poly x1%(i),z1%(i),x1%(i+1),z1%(i+1),x2%(i+1),z2%(i+1),x2%(i),z2%(i)
  64. 5160 next
  65. 5170 for i=0 to 68
  66. 5180 x1%(i)=x2%(i):z1%(i)=z2%(i)
  67. 5190 next
  68. 5200 next
  69. 5210 xc=22:yc=3:a$="f(x,y)=cos(x^2+y^2)/exp((x^2+y^2)/4)":gosub 6000
  70. 5220 _poly 172,20,468,20,468,34,172,34
  71. 5230 return
  72. 5240 tp=(x*x/73984*(NULL)+y*y/28224*(NULL))
  73. 5250 z=cos(tp*2)/exp(tp/2)*200
  74. 5260 xq=x*co+y*si:yq=-x*si+y*co:zq=z
  75. 5270 xp=xq:yp=zq*si+yq*co:zp=zq*co-yq*si
  76. 5280 xp=320+xp:zp=250-zp
  77. 5290 return
  78. 5999 :
  79. 6000 rem
  80. 6010 for i=0 to len(a$)-1
  81. 6020 _char xc+i,yc,asc(mid$(a$,i+1,1))
  82. 6030 next
  83. 6040 return
  84.