Shoving a shopping cart down the aisle
Tugging a wagon behind you
Earth pulls an apple down to the ground
How hard you push or pull. One Newton is about the weight of a small apple.
How much stuff is in an object. A bowling ball has more mass than a beach toy.
How quickly speed is changing. Flooring the gas in a car is high acceleration.
Every object with mass pulls on every other object.
The Sun pulls the Earth.
The Earth pulls the Moon.
The Earth pulls you — and you pull the Earth back (just very, very gently).
A tiny number (the gravity constant)
The two masses multiplied together
The distance between them
let y = 0; // position (how high up) let v = 0; // velocity (speed + direction) const m = 1; // mass in kg const g = 9.80665; // Earth's gravity function fall(dt) { const F = m * g; // F = m · a const a = F / m; // a = F ÷ m v += a * dt; // speed up each tick y += v * dt; // move by current speed }
const G = 1; // gravity strength function pull(a, b) { const dx = b.x - a.x; const dy = b.y - a.y; const r = Math.sqrt(dx*dx + dy*dy); // F = G · m1 · m2 / r^2 const F = G * a.m * b.m / (r * r); // a = F / m (from F = ma) a.ax += F * dx / r / a.m; a.ay += F * dy / r / a.m; }
Push harder, it speeds up faster. Heavier things need more force.
Everything with mass pulls. More mass, stronger pull.
JavaScript can simulate planets and falling balls.