You can read a formula for falling, but it is harder to spot its behaviour until you run it repeatedly. Code turns one relationship into a table, a picture, and a set of tests without changing the underlying physics.
For an object released from rest near Earth, the distance it has fallen is:
\[d=\\frac{1}{2}gt^2\]Here d is distance in metres, g is gravity in metres per second squared, and t is time in seconds. Notice the square: doubling time makes the distance four times as large.
This is one model shown three ways. The object starts at rest; air resistance is not included.
distance = ½ × 9.81 × time²
| Time (s) | Fallen (m) |
|---|---|
| 0.00 | 0.00 |
| 0.50 | 1.25 |
| 1.01 | 5.00 |
| 1.51 | 11.25 |
| 2.02 | 20.00 |
Landing time: 2.02 s
function distanceFallen(timeSeconds: number) {
return 0.5 * 9.81 * timeSeconds ** 2;
}
Prediction: If you double the height, the landing time will not double.
Set the height to 10 m and record the time. Then set it to 40 m. Compare the two times and explain the square-root relationship.Code does not make a formula more true. It makes repeated calculations, checks, and visual comparisons cheap enough to inspect. The formula is still the model; the diagram is only its output.
distanceFallen need?Treat the lesson as a small function before treating it as a fact to memorize. Give every value a unit, keep only the state needed for the next step, and make the output easy to inspect.
\[\text{observable output} = f(\text{inputs},\,\text{state})\]For Why Code Makes Physics Easier, write down the quantities you can control, the values your program must retain, and the result a reader could inspect. In Physics as Computation, the useful program is not the drawing: it is the smallest explicit model that makes a prediction you can test.
Prediction: changing one declared input while holding the others fixed should change only the outputs that the model connects to that input. Choose one input, predict the direction of change, then check a limiting case such as zero, a symmetric arrangement, or a familiar low-speed or small-change approximation.
This lesson is a teaching model, not a complete simulator. Before using it outside the stated question, check which interactions, scales, uncertainties, boundary conditions, and measurement limits it leaves out.
Treat Why Code Makes Physics Easier as a contract: named inputs and units enter a rule, the rule produces an observable result, and a known limit or invariant checks whether the implementation deserves trust.
See one falling-object model as an equation, computed data, and a motion diagram, then learn what code adds.