## Water Wave Simulation

Post your FreeBASIC tips and tricks here. Please don’t post your code without including an explanation.
Lothar Schirm
Posts: 333
Joined: Sep 28, 2013 15:08
Location: Bavaria, Germany

### Water Wave Simulation

A water wave consists of particles moving on vertical circles. The phase angle for each particle increases along the direction of the wave's motion. I found this description in "Gerthsen: Physik" which is a very well known book about physisc used in german universities. I tried a small simulation here:

Code: Select all

`Dim As Double x0, y0, r, phi, dt, tDim As Integer kScreenRes 1000, 100, 32WindowTitle "Water Wave"dt = 0.02y0 = 50r = 30t = 0Do   t = t + dt   Cls   ScreenLock   For k = 0 To 40      x0 = 25 * k      Circle (x0, y0), r, &HAAAAFF   'circle for each particle      phi = 0.5 * k      Circle (x0 + r * Sin(t - phi), y0 - r * Cos(t - phi)), 0.1 * r, &H00FFFF,,,, F   'particle   Next   ScreenUnlock   Sleep 10Loop Until Inkey = Chr(255, 107)End`
greenink
Posts: 200
Joined: Jan 28, 2016 15:45

### Re: Water Wave Simulation

German universities are number 1. Unfortunately somewhat starved of cash. The US universities are funded by 1 trillion dollars of student debt, giving them plenty of money for research.
Lothar Schirm
Posts: 333
Joined: Sep 28, 2013 15:08
Location: Bavaria, Germany

### Re: Water Wave Simulation

A description in English of such waves can also be found in the Wikipedia https://en.wikipedia.org/wiki/Trochoidal_wave.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

### Re: Water Wave Simulation

that is a really nice example, makes it look very easy and leads folks to envisioning how to use it in their projects... very nice!