Mechanics

Gravity

The universal attractive force — F = Gm₁m₂/r², the same for apples and galaxies

Gravity is the universal force of attraction between any two objects with mass. Newton's universal law of gravitation — F = Gm₁m₂/r² — describes how the same physics that drops apples also keeps planets in orbit and shapes galaxies. Einstein's general relativity later reframed gravity as the curvature of spacetime, but Newton's formula remains accurate for everyday and most astronomical situations.

  • Newton's lawF = G·m₁·m₂/r²
  • G (gravitational constant)6.674 × 10⁻¹¹ N·m²/kg²
  • g (Earth surface)9.81 m/s² (varies slightly with location)
  • Universal — applies to ALL massesApples to galaxies, same equation
  • Inverse-square lawF ∝ 1/r² — quadruples when distance halves
  • Einstein generalizationGeneral relativity — gravity = spacetime curvature

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

Newton's universal law

Every two masses attract each other with a force:

F = G · m₁ · m₂ / r²

where:

  • m₁, m₂ — the two masses (kg).
  • r — distance between centers (m).
  • G = 6.674 × 10⁻¹¹ N·m²/kg² — the gravitational constant.

The force is attractive (always pulling them together) and along the line connecting their centers. By Newton's third law, the force on object 1 from object 2 equals minus the force on 2 from 1.

Gravity at Earth's surface

For an object of mass m near Earth's surface (Earth mass M, radius R):

F = GMm/R² = m·g

where g = GM/R² ≈ 9.81 m/s² is the surface gravitational acceleration.

Locationg (m/s²)Why
Equator (sea level)9.78Earth bulges; centripetal effect; further from center
North/South pole9.83Closer to center; no centripetal reduction
Mt. Everest summit9.77Higher altitude → larger r → smaller g
ISS orbit (408 km up)8.69Still significant gravity; "floating" is free-fall
GPS orbit (20,200 km up)~0.56Far from Earth; ~6% of surface g
Earth's center0Mass surrounds you symmetrically — no net force

Surface gravity of celestial bodies

Bodyg (m/s²)Relative to Earth
Sun27427.9× Earth
Earth9.81
Mars3.710.38
Mercury3.700.38
Moon1.620.165
Jupiter (cloud tops)24.792.53
Saturn (cloud tops)10.441.06
Pluto0.620.063
Phobos (Mars's moon)0.00570.0006
Sirius B (white dwarf)~3,000,000~300,000×
Neutron star (typical)~10¹²~10¹¹×

Orbits — gravity as centripetal

For a circular orbit, gravity provides the centripetal force:

GMm/r² = mv²/r
v_orbit = √(GM/r)

Period from v = 2πr/T:

T = 2π·√(r³/(GM))

This is Kepler's third law — T² ∝ r³.

Escape velocity (just barely escapes to infinity):

v_escape = √(2GM/r) = √2 · v_orbit

For Earth surface: v_escape ≈ 11.2 km/s. For Sun: 617 km/s. For black holes: c (speed of light, by definition).

Einstein's reframing

In general relativity (1915), gravity is NOT a force. Mass and energy curve spacetime, and free-falling objects follow the "straightest possible" paths (geodesics) in that curved geometry.

Predictions matching Newton:

  • Apples falling, planets orbiting — basically Newtonian motion with tiny corrections.

Predictions where Einstein differs from Newton:

  • Mercury's perihelion precession — Mercury's elliptical orbit precesses by 43"/century more than Newton predicts. Einstein got it exactly.
  • Light bending — light passing the Sun bends by twice Newton's prediction. Confirmed by Eddington (1919) during a solar eclipse.
  • Time dilation — clocks in stronger gravity run slower. GPS satellites correct for this (~38 µs/day).
  • Gravitational waves — ripples in spacetime curvature, detected by LIGO (2015).
  • Black holes — extreme spacetime curvature; not even light escapes from inside the event horizon.

JavaScript — gravity calculations

// Newton's law of universal gravitation
const G = 6.674e-11;  // N·m²/kg²

function gravitationalForce(m1, m2, r) {
  return G * m1 * m2 / (r * r);
}

// Surface gravity for a body of mass M and radius R
function surfaceG(M, R) {
  return G * M / (R * R);
}

// Earth
const M_EARTH = 5.972e24;
const R_EARTH = 6.371e6;
console.log(`Earth surface g: ${surfaceG(M_EARTH, R_EARTH).toFixed(2)} m/s²`); // 9.82

// Moon
console.log(`Moon surface g: ${surfaceG(7.342e22, 1.737e6).toFixed(2)} m/s²`); // 1.62

// Orbital velocity for circular orbit
function orbitalVelocity(M, r) {
  return Math.sqrt(G * M / r);
}

// Escape velocity
function escapeVelocity(M, r) {
  return Math.sqrt(2 * G * M / r);
}

console.log(`ISS orbit: ${orbitalVelocity(M_EARTH, R_EARTH + 408e3).toFixed(0)} m/s`); // ~7,668
console.log(`Earth escape: ${escapeVelocity(M_EARTH, R_EARTH).toFixed(0)} m/s`);       // ~11,186

// Tidal force (gradient of gravity) — differential gravity from object of mass M at distance r over distance dr
function tidalForce(M, m, r, dr) {
  // Differentiate F = GMm/r² → dF/dr = -2GMm/r³, so Δ ≈ 2GMmdr/r³
  return 2 * G * M * m * dr / (r * r * r);
}

// Moon's tidal pull on a 1 m water column (Earth's radius gives dr ≈ Earth's diameter for full tidal range)
const moonTidal = tidalForce(7.342e22, 1, 384400e3, 6.371e6);
console.log(`Moon tidal force per kg: ${(moonTidal*1e7).toFixed(2)}×10⁻⁷ N`);

// Time to fall from height h (no air resistance)
function fallTime(h, g = 9.81) {
  return Math.sqrt(2 * h / g);
}

console.log(`Fall 100m: ${fallTime(100).toFixed(2)} s`); // ~4.5 s
console.log(`Fall 1000m: ${fallTime(1000).toFixed(2)} s`); // ~14.3 s

Where gravity shows up

  • Astronomy. All planetary, stellar, and galactic dynamics. Solar system structure, exoplanet detection, galaxy rotation curves.
  • Space mission design. Trajectory optimization, gravitational slingshots, orbit transfers (Hohmann), launch windows.
  • Geodesy. Mapping Earth's gravity (gravity anomalies indicate dense or sparse subsurface — used for oil exploration).
  • Engineering — structures. Buildings, bridges, dams — must withstand gravitational loading. Static analysis of all weight-bearing structures.
  • Sports physics. Projectile trajectories (basketball, football, golf), pendulums (clocks, swings).
  • Cosmology. Universe expansion (gravity vs dark energy), structure formation (galaxy clustering), dark matter inferred from rotation curves.
  • Geophysics. Plate tectonics, mountain building, volcanic eruptions — all driven by gravitational potential energy.

Common mistakes

  • Confusing weight with mass. Weight = mg (force). Mass is intrinsic. On Mars, weight is 38% of Earth's; mass is unchanged.
  • Thinking g is constant everywhere. g varies with altitude (g goes as 1/r² with distance from Earth's center), latitude (Earth's bulge + rotation), and local geology.
  • Forgetting the inverse-square law. Doubling distance from a planet quadruples the reduction in force (and acceleration).
  • Treating gravity as a force in general relativity. In GR, gravity is geometry, not force. For everyday physics, Newton's force picture works perfectly.
  • Misapplying near vs far-from-Earth formulas. Use F = mg only near Earth's surface (h ≪ R_Earth). For higher altitudes, use F = GMm/r² with full r = R + h.
  • Confusing G (universal) with g (local). G is a fundamental constant; g is the local acceleration on a specific body. g = GM/R² for that body.

Frequently asked questions

Why is gravity inverse-square?

Consider gravity emanating from a point. Imagine spheres centered on the point. The "gravitational influence" passes through each sphere, with the area of the sphere being 4πr². Spreading the same total over a larger sphere (r increases) means less per square meter — proportional to 1/r². This geometric argument applies to any "spreading from a point" phenomenon — light intensity, electric field, sound (in 3D). Modern view via general relativity gives the same Newtonian limit at low speeds.

Why is g = 9.81 m/s² on Earth?

Plug in Earth's mass and radius into Newton's law. F = GMm/R² gives acceleration g = GM/R² = (6.67×10⁻¹¹ × 5.97×10²⁴)/(6.37×10⁶)² = 9.81 m/s². Varies slightly with latitude (centripetal effect from Earth's rotation reduces apparent g at equator), altitude (decreases with height), and local geology (mountains, dense ore deposits).

How does gravity at the Moon compare?

Moon mass ~ 1/81 Earth's; radius ~ 1/3.7 Earth's. g_moon = GM_moon/R_moon² ≈ 1.62 m/s² (about 1/6 Earth). On Mars, g ~ 3.71 m/s² (~1/3 Earth). On Sun's surface, g ~ 274 m/s² (28× Earth). Gravity goes as M/R² for surface acceleration.

How did Newton derive the inverse-square law?

From Kepler's third law (T² ∝ r³). Applying F = ma to circular orbits: F = mv²/r = m(2πr/T)²/r = 4π²m·r/T². If F ∝ 1/r², then 4π²·r/T² ∝ 1/r², giving T² ∝ r³ — exactly Kepler's third law. Conversely, Kepler's law implies F ∝ 1/r². Newton showed that the same force drops apples and orbits Moon — universal gravitation.

How is general relativity different from Newton?

Newton — gravity is a force pulling masses together. Einstein (1915) — masses curve spacetime; objects move along the "straightest paths" in this curved geometry (geodesics). For weak gravity (Earth, solar system), Einstein's predictions match Newton's almost exactly. Differences appear at very high mass/density (black holes), high speeds (relativistic), or very precise tests (Mercury's perihelion precession, GPS time dilation, light bending around Sun).

How do tides work?

Moon's gravity is stronger on Earth's near side than far side (tidal gradient). The differential creates a "stretching" — water on the near side bulges toward Moon; water on the far side bulges away (relative to Earth's center). Earth rotates through these bulges, giving two high tides per day (12.42-hour separation). Sun also creates tides (~½ Moon's effect); together they give spring tides (aligned) and neap tides (perpendicular).

Why is gravity so weak compared to other forces?

Gravity is by far the weakest fundamental force — at the atomic scale, electromagnetism is ~10³⁶ times stronger. But gravity is always attractive, while electromagnetism cancels (positive and negative charges balance). On large scales (planets, stars, galaxies), gravity wins because matter is electrically neutral. Why gravity is so weak at small scales is one of physics's biggest open questions — addressed by attempts at quantum gravity, string theory, etc.