Lesson 1 of 15

Average Velocity

Velocity and Displacement

Displacement is the change in position: Δx=x1x0\Delta x = x_1 - x_0.

Average velocity is displacement divided by elapsed time:

v=ΔxΔt=x1x0Δtv = \frac{\Delta x}{\Delta t} = \frac{x_1 - x_0}{\Delta t}

Units: metres per second (m/s). Velocity can be negative — it just means motion in the negative direction.

Examples

x0x_0 (m)x1x_1 (m)Δt\Delta t (s)vv (m/s)
01025.0
100505−10.0
0100425.0

Instantaneous vs Average

Average velocity is measured over a finite interval. As Δt0\Delta t \to 0, it becomes the instantaneous velocity — the derivative dx/dtdx/dt. For constant velocity the two are identical.

Your Task

Implement velocity(x0, x1, dt) that returns average velocity in m/s.

TCC compiler loading...
Loading...
Click "Run" to execute your code.