I modified Tom Walsh’s original GeoGebra app to add a single oscillating particle for students to observe the direction of oscillation, as well as to optimise it for the Student Learning Space.
You can choose to shift the particle that you want to focus on.
The app can also be used to show how the displacement of a particle in a longitudinal wave can be mapped onto a sinusoidal function, similar to the shape of a transverse wave. For example. a displacement of the particle to the right can be represented by a positive displacement value on the displacement-distance graph.
Here is an animated gif for those who prefer to insert it into a powerpoint slideshow instead:
This is the original app:
The good thing about GeoGebra apps is that everything is open-source – free for anyone to edit. Being able to read the “source code” or rather, the mathematical syntax used by others, I have learnt a lot. For example, I learnt how to use Sequences from this original app to generate oscillating lines with different phases.