Author Topic: Arc Wave  (Read 3044 times)

0 Members and 1 Guest are viewing this topic.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Arc Wave
« 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.  
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

FellippeHeitor

  • Guest
Re: Arc Wave
« Reply #1 on: March 11, 2018, 04:20:02 pm »
That's beautiful Ashish.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
Re: Arc Wave
« Reply #2 on: March 12, 2018, 02:19:40 am »
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials