QB64.org Forum

Active Forums => Programs => Topic started by: Ashish on March 11, 2018, 01:00:54 pm

Title: Arc Wave
Post by: Ashish on March 11, 2018, 01:00:54 pm
Waves form by the harmonic motion of the arcs....
Code: QB64: [Select]
  1. _TITLE "Arc Wave!"
  2.  
  3. SCREEN _NEWIMAGE(600, 600, 32)
  4.  
  5. angOffset# = 0
  6.  
  7.     CLS
  8.     FOR i = 1 TO 30
  9.         r = i * 8
  10.         drawArc _WIDTH / 2, _HEIGHT / 2, r, _PI, _PI + ABS(SIN(angOffset# + i / 10) * _PI)
  11.     NEXT
  12.     angOffset# = angOffset# + .01
  13.     _DISPLAY
  14.     _LIMIT 60
  15.  
  16.  
  17. SUB drawArc (xx, yy, r, s#, e#)
  18.     px = COS(s#) * r + xx
  19.     py = SIN(s#) * r + yy
  20.     FOR i = s# TO e# STEP .02
  21.         x = COS(i) * r + xx
  22.         y = SIN(i) * r + yy
  23.         LINE (x, y)-(px, py)
  24.         px = x
  25.         py = y
  26.     NEXT
  27.  
  28.  
Title: Re: Arc Wave
Post by: FellippeHeitor on March 11, 2018, 04:20:02 pm
That's beautiful Ashish.
Title: Re: Arc Wave
Post by: Ashish on March 12, 2018, 02:19:40 am
That's beautiful Ashish.
Thanks! :)