Simple harmonic motion is the motion of a simple harmonic oscillator. The motion is periodic, as it repeats itself at standard intervals in a specific manner with constant amplitude. It is characterized by its amplitude , its period which is the time for a single oscillation, its frequency which is the number of cycles per unit time, and its phase, which determines the starting point on the sine wave. The period, and its inverse the frequency, are constants determined by the overall system, while the amplitude and phase are determined by the initial conditions (position and velocity) of that system. (Wikipedia, 2008).
The general equation describing simple harmonic motion is
x=Acos(2pft+f), where x is the displacement, A is the amplitude of the oscillation, f is the frequency, t is the elapsed time and f is the phase of oscillation.
To create a simple model of simple harmonic motion in Visual Basic , we used the equation x=Acos(wt), and we have assigned a value of 500 to A and a value of 50 to w. In this program, the circular object which we have inserted into the form will oscillate from left to right and vice versa, reaching the maximum speed at the middle of the path.
Learn how to write the code for SHM by following the link below: