Game Development Reference
In-Depth Information
x 0 and v 0 with the phase offset θ 0 , which describes where in the cycle the
spring is at t = 0. Adjustments to the phase offset have the simple effect
of shifting the graph horizontally on the time axis. Adding these two vari-
ables, we arrive at the general solution, the equations of simple harmonic
oscillation.
Simple Harmonic Motion
x(t) = Acos(ωt + θ 0 ),
(12.10)
x(t) = −Aω sin(ωt + θ 0 ),
x(t) = −Aω 2 cos(ωt + θ 0 ).
Now let's make some observations. First, remember that the sine and
cosine functions are just shifted versions of each other: sin(t+π/2) = cos(t).
Thus we could have written x(t) using sine instead of cosine, the choice
being mostly a matter of preference and an adjustment in the phase by
π/2. The term “sinusoidal” can be used to refer to the shape of the sine
and cosine functions, and we use it when either function will do.
Second, consider the frequency of oscillation. The sine and cosine func-
tions have a period of 2π; thus the oscillator will complete one cycle in the
time it takes for ωt to increase by 2π. The angular frequency ω is measured
in radians per unit time, but we can also measure the frequency F, which
is in cycles per unit time, as
k
m .
Notice that the frequency of oscillation depends only on ratio of the spring
stiffness to the mass. In particular, it does not depend on the initial dis-
placement x 0 : if we stretch the spring farther before letting it go, the
amplitude increases, but the frequency will not change.
In many situations, the frequency is the important number we wish to
control. This is especially the case for “virtual springs,” which are really
control systems in disguise. In these situations, we don't need to bother
with spring constants or masses, and we can write the equation of motion
directly in terms of frequency, as
F = ω
K
=
1
Frequency of simple
harmonic motion
=
Simple harmonic motion
in terms of frequency
x(t) = Acos(2πFt + θ 0 ).
Search WWH ::




Custom Search