Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Dynamics  ›  Lesson

Linear Velocity and Acceleration

Linear Velocity 12 minEach physics step, acceleration times the time step changes velocity and then velocity times the time step changes position, which is how a game integrates motion.

Linear Velocity and Acceleration

The drone releases a crate while flying along the quay. The crate doesn't drop straight down: it keeps drifting forward as it falls faster and faster, tracing a curve toward the boat below. Two lines of code, run every physics step, draw that curve.

The rule

Acceleration nudges velocity; velocity nudges position; both times dt.

Linear velocity v\mathbf{v} is how fast position changes, as a vector in m/s; its length is the speed. Acceleration a\mathbf{a} is how fast velocity changes, in m/s². Near the ground, gravity gives every falling object the same acceleration, a=(0,−9.8)\mathbf{a} = (0, -9.8).

Each fixed physics step, the engine runs:

velocity += acceleration * dt
position += velocity * dt

This is semi-implicit Euler integration: update the velocity first, then move using the new velocity. It costs nothing more than doing it the other way round, and it stays stable for springs and orbits, where the "move first" version slowly gains energy until things fly apart.

Because vectors work one component at a time, the horizontal and vertical parts don't interfere with each other. With gravity pointing straight down, horizontal velocity never changes; only the vertical velocity grows.

Why step at all, when school physics has an exact formula for a falling object? Because in a game the forces keep changing: the player throttles up, the wind gusts, the crate clips a mast. Stepping handles any force the moment it appears, and with small, equal steps the result stays very close to the exact path.

The shortcut

Velocity first, then position, one component at a time. By hand, use a coarse step so the numbers stay readable (the game itself uses 0.02 s).

A crate released at (0, 12) from a drone flying at (4, 0) m/s, with dt = 0.5 sStep 1 of 5
  1. Step 1: velocity

    (4, 0) + (0, −9.8) × 0.5 = (4, −4.9).

Two traps. Forgetting dt adds a per-second amount every step. And giving a released crate zero velocity is wrong: it inherits the drone's velocity at the moment of release, which is exactly why it drifts forward instead of dropping like a stone.

Drills

Answer fast — trust the rule.

A crate falls at velocity (0, −3) m/s. After one step of dt = 0.02 s under gravity (0, −9.8), what is its vertical velocity in m/s?
−3+(−9.8)×0.02= ?-3 + (-9.8) \times 0.02 = \,?
quick drill

The drone flies at (4, 0) m/s when it releases a crate. Ignoring air, what is the crate's horizontal velocity one second later?

quick drill

What does semi-implicit Euler do each step?

quick drill

A gull glides at velocity (−3, 4) m/s. What is its speed?

quick drill

The gull's velocity stays at (−3, 4) m/s for 2 seconds. What is its acceleration?

Remember

  • Each step: velocity += acceleration × dt, then position += velocity × dt.
  • Components are independent: gravity changes only the vertical velocity.
  • Traps: forgetting dt, and forgetting that a released object keeps its carrier's velocity.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainTwo steps of a crate drop

Walk a teammate through two physics steps (dt = 0.5 s) of a crate released at (0, 12) from a drone flying at (4, 0) m/s, and explain why the horizontal and vertical parts of the motion behave differently.