Game Development Reference

In-Depth Information

v
2
= (T/C) - e
-(C/m) t
(T/C - v
1
)

where
v
1
is the initial ship speed (which is constant) and
v
2
is the ship speed at time
t
.

v
2
is what you're after here, since it tells you how fast the ship is traveling at any instant

of time.

Now that you have an equation for speed as a function of time, you can derive an

equation for displacement (distance traveled, in this case) as a function of time. Here,

you'll have to recall the formula
v dt
=
ds
, substitute the previous formula for speed,

integrate, rearrange, and solve for distance traveled. These steps are shown here:

v dt = ds

v
2
dt = ds

((T/C) - e
-(C/m) t
(T/C - v
1
)) dt = ds

∫
(0 to t)
(T/C) - e
-(C/m) t
(T/C - v
1
) dt = ∫
(s1 to s2)
ds

(T/C) ∫
(0 to t)
dt - (T/C - v
1
) ∫
(0 to t)
e
-(C/m) t
dt = s
2
- s
1

[(T/C) t + ((T/C) - v
1
)(m/C) e
-(C/m) t
]
(0 to t)
= s
2
- s
1

[(T/C) t + ((T/C) - v
1
)(m/C) e
-(C/m) t
] - [0 + ((T/C) - v
1
)(m/C)] =

s
2
- s
1

(T/C) t + (T/C - v
1
) (m/C) e
-(C/m) t
- (T/C - v
1
) (m/C) = s
2
- s
1

s
2
= s
1
+ (T/C) t + (T/C - v
1
) (m/C) e
-(C/m) t
- (T/C - v
1
) (m/C)

Finally you can write an equation for acceleration by going back to the original equation

of motion and solving for acceleration:

T - (C v) = m a

a = (T - (C v)) / m

where:

v = v
2
= (T/C) - e
-(C/m) t
(T/C - v
1
)

In summary, the equations for velocity, distance traveled, and acceleration are as follows:

v
2
= (T/C) - e
-(C/m) t
(T/C - v
1
)

s
2
= s
1
+ (T/C) t + (T/C - v
1
) (m/C) e
-(C/m) t
- (T/C - v
1
) (m/C)

a = (T - (C v)) / m

To illustrate the motion of the ship further, we've plotted the ship's speed, distance trav‐

eled, and acceleration versus time, as shown in
Figure 4-2
,
Figure 4-3
, and
Figure 4-4
.

To facilitate these illustrations, we've assumed the following: