Mechanics

Gravitational Field

The "force per unit mass" any object would feel — like an invisible vector field around any mass

A gravitational field g is the acceleration any test mass would experience at that point — equivalent to "force per unit mass." Around a point mass M, |g| = GM/r². The field is a vector at every point, pointing toward the source. Useful for analyzing complex setups (multiple masses, hollow shells, arbitrary distributions) where you compute the field once, then any test mass simply experiences F = m·g.

  • Definitiong(r) = F(r) / m_test (acceleration of a test mass at point r)
  • Around a point mass|g| = GM/r², direction toward M
  • Unitsm/s² (same as acceleration) or N/kg (same value, "force per kg")
  • Earth's surfaceg ≈ 9.81 m/s², downward
  • Field linesPoint toward masses; density indicates strength
  • Superpositiong_total = sum of all individual g vectors

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.

Definition

The gravitational field g at a point is the gravitational force per unit mass that a test mass would experience there:

g(r) = F(r) / m_test

It's a vector field — has direction and magnitude at every point in space. Direction is toward the source mass; magnitude depends on geometry.

Units: m/s² (same as acceleration) — equivalent to N/kg ("newtons per kilogram"). For any object placed at that point, force is F = m·g.

Around a point mass

For a single point mass M, the field at distance r:

|g| = GM / r²

pointing radially inward (toward M).

This is the same magnitude as F/m_test from Newton's law. The field exists in space whether or not a test mass is there.

Superposition

For multiple masses, total field is the vector sum of individual fields:

g_total(r) = g_1(r) + g_2(r) + g_3(r) + ...

Each g_i is the field from mass i alone, computed at the point r. Add them as vectors.

This is why gravity is mathematically clean — sum of pairwise contributions.

Newton's Shell Theorem

Inside a spherically symmetric shell of mass, the gravitational field is exactly zero.

And: outside the shell, the field is identical to that of a point mass at the center, with the same total mass.

This is why we can treat planets (approximately spherical) as point masses for orbital calculations. It also means an object dropped into a hypothetical hole through Earth would experience decreasing g as it descended (less mass below contributing), reaching zero at the center, then increasing again toward the other side.

PositionField outside shellField inside shell
r > RGM/r² (point-mass-like)
r < R (interior)0 exactly

Earth's gravitational field

Earth's field is approximately:

g(r) = GM_E / r² (downward)

At Earth's surface (r = R = 6.371 × 10⁶ m), g ≈ 9.81 m/s².

Variations:

  • Latitude. Earth bulges at the equator and is slightly flat at poles. Plus, centripetal effect at the equator (Earth rotates) reduces apparent g. Sea-level g varies from 9.78 (equator) to 9.83 m/s² (poles).
  • Altitude. g decreases with height as 1/(R + h)². At h = 10 km (commercial flight), g ≈ 9.78 m/s² (only 0.3% less).
  • Local geology. Dense ore bodies and mountains create gravity anomalies — used for mineral exploration, oil finding.
  • Inside the Earth. By shell theorem, only mass at smaller r contributes. Density increases with depth, so g actually rises slightly going inward (reaching ~10.7 m/s² at the outer core boundary), then falls to zero at the center.

Field-line visualization

Field lines:

  • Point in the direction of g (toward sources).
  • Density (lines per area) is proportional to |g|.
  • Never cross (field has unique direction at each point).
  • Don't form closed loops (gravity is conservative).

For a single mass, lines radiate inward like spokes. For two equal masses, lines curve from "neutral point" (between them) outward and inward. For a Dyson sphere, no lines inside (zero field), normal lines outside.

JavaScript — gravitational field calculations

const G = 6.674e-11;

// Field from a single point mass at the origin
function pointMassField(M, x, y, z) {
  const r2 = x*x + y*y + z*z;
  const r = Math.sqrt(r2);
  if (r < 1e-9) return [0, 0, 0]; // singularity at the mass
  // g points from (x,y,z) toward origin → (-x,-y,-z)/r * GM/r²
  const factor = -G * M / (r * r2);  // includes 1/r factor for unit vector
  return [factor * x, factor * y, factor * z];
}

// Total field from multiple masses
function totalField(masses, positions, x, y, z) {
  let gx = 0, gy = 0, gz = 0;
  for (let i = 0; i < masses.length; i++) {
    const dx = x - positions[i][0];
    const dy = y - positions[i][1];
    const dz = z - positions[i][2];
    const r2 = dx*dx + dy*dy + dz*dz;
    const r = Math.sqrt(r2);
    const factor = -G * masses[i] / (r * r2);
    gx += factor * dx;
    gy += factor * dy;
    gz += factor * dz;
  }
  return [gx, gy, gz];
}

// Earth's surface field
const M_EARTH = 5.972e24;
const R_EARTH = 6.371e6;
const g_at_surface = pointMassField(M_EARTH, R_EARTH, 0, 0);
console.log(`g at Earth surface: ${Math.abs(g_at_surface[0]).toFixed(2)} m/s²`); // ~9.81

// Earth-Moon field at L1 (between them, ~85% of distance to Moon)
const M_MOON = 7.342e22;
const D_EM = 384400e3;
const x_L1 = 0.849 * D_EM;
const field_L1 = totalField(
  [M_EARTH, M_MOON],
  [[0, 0, 0], [D_EM, 0, 0]],
  x_L1, 0, 0
);
console.log(`Field at L1: ${field_L1[0].toExponential(2)} m/s² (should be near zero)`);

// Inside hollow shell — Shell Theorem
// In a real implementation we'd integrate over shell mass; for symmetry,
// the result is zero. Here a simple test: shell of N point masses arranged
// uniformly on a sphere.
function shellTest(M_total, R_shell, N = 1000, x_test = 0) {
  const masses = Array(N).fill(M_total / N);
  const positions = [];
  for (let i = 0; i < N; i++) {
    // Distribute on sphere using Fibonacci spiral
    const phi = Math.acos(1 - 2 * (i + 0.5) / N);
    const theta = Math.PI * (1 + Math.sqrt(5)) * i;
    positions.push([
      R_shell * Math.sin(phi) * Math.cos(theta),
      R_shell * Math.sin(phi) * Math.sin(theta),
      R_shell * Math.cos(phi)
    ]);
  }
  return totalField(masses, positions, x_test, 0, 0);
}

const inside = shellTest(1, 1, 1000, 0);  // at center of shell
console.log(`Inside shell field magnitude: ${Math.sqrt(inside[0]**2 + inside[1]**2 + inside[2]**2).toExponential(2)}`);
// Should be ~0 (numerical error from finite N)

Where gravitational fields show up

  • Spacecraft trajectory design. Field maps for Earth's non-spherical gravity (J2, J22 terms) needed for accurate orbit propagation.
  • Geodesy. Earth's geoid is the equipotential surface of Earth's gravity field at sea level. Gravity anomaly maps used for geology.
  • Astrophysics. Galaxy rotation curves measure dark matter via gravitational field; gravitational lensing observed from field bending of light.
  • Gravimeters. Devices measuring local g to high precision for prospecting (oil, water, ore deposits).
  • Tidal physics. Tides arise from gradient of gravitational field (differential field across Earth).
  • Lagrangian points. L1, L2, L3, L4, L5 — points where Earth-Moon-Sun fields balance for spacecraft "parking." James Webb Space Telescope sits at L2.
  • General relativity. Reformulates gravity as spacetime geometry; the "field" becomes the metric tensor of curved spacetime.

Common mistakes

  • Confusing field with force. Field is force per unit mass (g, units N/kg). Force is field times mass (F = mg, units N). Different quantities.
  • Forgetting it's a vector. g has direction (toward sources). Add fields from multiple sources as vectors, not scalars.
  • Applying point-mass formula inside a body. g = GM/r² assumes you're outside a spherically symmetric mass. Inside, only enclosed mass at smaller r contributes (shell theorem).
  • Confusing G (universal) with g (local field strength). G is a constant. g varies depending on location relative to masses.
  • Treating gravity as instantaneous. In Newton's picture, field changes propagate instantaneously. In general relativity, gravitational influence travels at c (gravitational waves).
  • Forgetting Newton-relativity hierarchy. Newton's field works for weak gravity (everyday + most solar system). General relativity needed for black holes, neutron stars, cosmology.

Frequently asked questions

Why use a field instead of force?

For systems with many interacting masses, computing fields first is cleaner. Once you know g at every point in space (from all source masses), any test mass m experiences F = mg — simple. With pure pairwise force calculations, you'd compute force on m from each source separately, then sum. Same answer, but field-based thinking generalizes to electromagnetism and beyond.

How do gravitational field lines work?

Field lines point in the direction of g (toward a point mass) and field-line density indicates strength. Around a single mass, field lines radiate inward like spokes; magnitude falls as 1/r² (more spread-out far away). For two masses, fields add vectorially — field lines bend, with possible "neutral points" (where g = 0) between them.

What's inside a hollow spherical shell?

Zero gravitational field! For a spherically symmetric shell, the field inside is exactly zero — proved by Newton (Shell Theorem). Mass on one side cancels mass on the other; symmetry ensures perfect cancellation. This is why space inside a thin Dyson sphere or sufficiently spherical hollow planet would be "weightless" (in terms of field). Note — outside the shell, field equals that of a point mass at the center.

How does superposition work?

For multiple masses, total gravitational field at a point is the vector sum of fields from each mass — g_total = g_1 + g_2 + g_3 + .... This works because gravity (in Newton's framework) is linear. So a system with N masses requires N field calculations, then a vector sum. Same idea applies to electric fields (and is exact at all scales for linear theories).

How is gravitational field different from gravitational potential?

Potential is a scalar (φ); field is a vector (g). They're related — g = -∇φ (negative gradient of potential). Potential is easier to compute (no vector arithmetic, just sum scalars from sources), then take gradient at the end. Both contain same physics; potential is computationally simpler for many problems.

How does it apply to satellite orbits?

A satellite at radius r feels acceleration g(r) = GM/r² toward Earth's center. For circular orbit — centripetal a = v²/r = GM/r² → v = √(GM/r). The field gives the centripetal acceleration; Newton's 2nd determines orbit. Satellites at different altitudes experience different field strengths.

What about non-spherical sources?

For irregular masses (Earth has bulge + mountains; binary star pairs), the field is more complex. Decompose into multipole moments — monopole (point mass), dipole, quadrupole, etc. Earth's "non-sphericity" (oblateness, J2 term) significantly affects satellite orbits. Gravity gradiometry maps subsurface density anomalies via field variations.