Search

Search papers and lessons

Geodesic

Level 3 · 12 min read

A geodesic is a locally shortest path on a curved space, and it is the path a free object follows when no force acts on it.

On this page

  • Colour = topic mix
  • Calculus
  • Linear algebra
  • Discrete math
  • Optimization
  • Relativity
  • ReadReady to readNot yet

TL;DR

A geodesic is a curve that is locally the shortest path: between two points that are close together on a curved space, no nearby curve with the same ends is shorter. Geodesics are the paths that free objects follow when no force acts on them, so they are the straight lines of a curved space. You find them by writing the length of a curve as an integral, minimising it, and reading off the geodesic equation.

Builds on: Riemannian Geometry, Calculus of Variations · Leads to: General Relativity, Equivalence Principle

Where it's used

Air and sea routes. The Earth is close to a sphere, and the shortest route between two cities on a sphere is an arc of a great circle, a circle whose centre is the centre of the Earth. Navigators use this to save fuel on long flights. On a flat map a great circle looks curved, which is why long-haul northern routes often bend toward the pole. The rule that picks the route is a geodesic rule on the sphere, and it needs the sphere's metric.

Gravity in general relativity. Einstein's theory says that a planet, a satellite or a falling apple moves along a geodesic of spacetime, and that mass and energy curve spacetime. Light also follows geodesics of spacetime, which is why starlight passing the Sun bends. The 1919 solar eclipse expedition measured this bending, and the result agreed with Einstein's prediction rather than the older Newtonian estimate. This is the setting of general relativity.

Shape analysis in computer graphics. Engineers who work with 3D models need the distance between two points on a surface, measured along the surface rather than through the air. Such distances are geodesic distances. They are used to match shapes, to find smooth paths across a model, and to compare parts of a surface that are far apart along it.

How it works

Take one tiny instance: a flat sheet whose coordinates are (u,v)(u, v), but whose metric stretches the uu direction. A metric is a rule for measuring how long a small move is. Here it is the table with 4 and 0 in the top row and 0 and 1 in the bottom row, the same at every point. A move with components (a,b)(a, b) has squared length 4a2+b24a^2 + b^2.

  1. Pick two points. Let A=(0,0)A = (0, 0) and B=(1,1)B = (1, 1). We want the shortest path from AA to BB on this sheet.

  2. Take the straight candidate. Walk the segment u=tu = t, v=tv = t for tt from 0 to 1. Its velocity is (1,1)(1, 1) at every moment. Check: after time 1 we are at (1,1)(1, 1), which is BB.

  3. Measure the speed of that candidate. Put the velocity into the metric: 4⋅12+12=54 \cdot 1^2 + 1^2 = 5. So the speed is 5\sqrt{5}, about 2.24, and it is the same at every moment. Check: the move (1,0)(1, 0) alone has speed 2. Adding the vv part raises the squared speed from 4 to 5, so the speed rises from 2 to 5\sqrt{5}, as it should.

  4. Multiply speed by time to get the length. The length is 5×1≈2.24\sqrt{5} \times 1 \approx 2.24. Check: the straight candidate has length about 2.24.

  5. Try a rival. Walk first from AA to (1,0)(1, 0), then up to BB. The first leg has velocity (1,0)(1, 0), speed 2, and length 2. The second leg has velocity (0,1)(0, 1), speed 1, and length 1. Total length: 3. Check: 3 is larger than 2.24.

  6. Compare and conclude. The straight candidate beats this rival. Both candidates have the same ends, so the straight segment is the shorter of the two, and on this sheet, whose metric is the same everywhere, it is a geodesic. Check: no part of the straight segment is better than any other part, because the metric does not change from place to place.

flowchart LR
  A["Two points A and B"] --> B["Choose a candidate curve"]
  B --> C["Measure its length with the metric"]
  C --> D["Compare with nearby curves"]
  D --> E["Does any nearby curve beat it?"]
  E -->|no| F["It is a geodesic"]
  E -->|yes| B

Step 6 shows only that one rival loses. A full answer must rule out every nearby curve, and that needs calculus, which is the next section.

The math

A geodesic is a curve that is locally length-minimising: for any two of its points that are close enough, no other curve joining them and staying nearby is shorter. Let the coordinates be x1,x2x^1, x^2 (in the walkthrough x1=ux^1 = u, x2=vx^2 = v), and let the metric have components gijg_{ij} at each point. A curve is given by functions xk(t)x^k(t), and its velocity vector has components x˙k=dxk/dt\dot{x}^k = dx^k/dt.

Definition: Geodesic
A curve that is locally the shortest path between its points, where length is measured by the metric. Equivalently, it is a solution of the geodesic equation given below.

Step 3 in symbols: speed and length

The squared speed of a curve at time tt is ∑i,jgij x˙ix˙j\sum_{i,j} g_{ij}\,\dot{x}^i \dot{x}^j, where ∑i,j\sum_{i,j} means add over all pairs of coordinate labels. The length of the curve from t=0t = 0 to t=1t = 1 is

L=∫01∑i,jgij x˙ix˙j  dt.L = \int_0^1 \sqrt{\sum_{i,j} g_{ij}\,\dot{x}^i \dot{x}^j}\; dt.

For the walkthrough, g11=4g_{11} = 4, g22=1g_{22} = 1, and g12=g21=0g_{12} = g_{21} = 0. The square root of 4⋅12+1⋅124\cdot 1^2 + 1 \cdot 1^2 is 5\sqrt{5}, and since it does not depend on tt, the integral is just 5\sqrt{5} times 1. This gives step 4.

Step 5 in symbols: the energy trick

Minimising LL directly is awkward because of the square root. Instead minimise the energy, the same kind of action that Lagrangian mechanics minimises,

E=12∫01∑i,jgij x˙ix˙j dt.E = \frac{1}{2}\int_0^1 \sum_{i,j} g_{ij}\,\dot{x}^i \dot{x}^j\, dt.

Among curves with fixed ends on [0,1][0, 1], the minimisers of EE are the same curves as the minimisers of LL, and they have constant speed. So we can work with EE. This is a standard fact that follows from the Cauchy–Schwarz inequality, which gives L2≤2EL^2 \le 2E with equality exactly at constant speed.

Apply the Euler–Lagrange equation from Calculus of Variations to the integrand 12gijx˙ix˙j\frac{1}{2} g_{ij}\dot{x}^i \dot{x}^j. The result is the geodesic equation,

x¨k+∑i,jΓijk x˙ix˙j=0,\ddot{x}^k + \sum_{i,j} \Gamma^k_{ij}\,\dot{x}^i \dot{x}^j = 0,

where x¨k=d2xk/dt2\ddot{x}^k = d^2 x^k/dt^2 is the acceleration in coordinates, and Γijk\Gamma^k_{ij} are the Christoffel symbols. In words: the coordinate acceleration of a free curve equals a correction term that depends on how the metric changes from place to place.

The Christoffel symbols

The Christoffel symbols come from the derivatives of the metric. Write ∂igjl\partial_i g_{jl} for the partial derivative of gjlg_{jl} with respect to xix^i. Then

Γijk=12∑lgkl(∂igjl+∂jgil−∂lgij),\Gamma^k_{ij} = \frac{1}{2} \sum_{l} g^{kl}\left(\partial_i g_{jl} + \partial_j g_{il} - \partial_l g_{ij}\right),

where gklg^{kl} is the inverse matrix of gklg_{kl}. If the metric is the same everywhere, every ∂igjl\partial_i g_{jl} is zero, so every Γijk\Gamma^k_{ij} is zero. Then the geodesic equation says x¨k=0\ddot{x}^k = 0, which means the coordinates move in straight lines. This is why step 6 works for the stretched sheet.

Worked examples

Example
1. Length of a straight segment

Use the stretched sheet with g11=4g_{11} = 4, g22=1g_{22} = 1.

  1. Take the segment from (0,0)(0, 0) to (0,3)(0, 3), parametrised as x1=0x^1 = 0, x2=sx^2 = s for ss from 0 to 3.
  2. The velocity is (0,1)(0, 1), so x˙1=0\dot{x}^1 = 0 and x˙2=1\dot{x}^2 = 1.
  3. The squared speed is 4⋅02+1⋅12=14 \cdot 0^2 + 1 \cdot 1^2 = 1, so the speed is 1.
  4. The length is the speed times the duration, 1×3=31 \times 3 = 3.

Interpretation: a move straight along the vv direction is measured at face value, because g22=1g_{22} = 1. Answer: length 3.

Example
2. Polar coordinates on a flat plane

The ordinary flat plane in polar coordinates (r,θ)(r, \theta) has metric dr2+r2dθ2dr^2 + r^2 d\theta^2, so grr=1g_{rr} = 1, gθθ=r2g_{\theta\theta} = r^2 and grθ=0g_{r\theta} = 0. Here the metric changes with rr, so some Christoffel symbols are nonzero. The two that matter are

Γθθr=−r,Γrθθ=1r.\Gamma^r_{\theta\theta} = -r, \qquad \Gamma^\theta_{r\theta} = \frac{1}{r}.

  1. Compute Γθθr\Gamma^r_{\theta\theta} from the formula. The only relevant derivative is ∂rgθθ=2r\partial_r g_{\theta\theta} = 2r, and grr=1g^{rr} = 1. So Γθθr=12⋅1⋅(−2r)=−r\Gamma^r_{\theta\theta} = \frac{1}{2}\cdot 1\cdot(-2r) = -r.
  2. Compute Γrθθ\Gamma^\theta_{r\theta}. Here gθθ=1/r2g^{\theta\theta} = 1/r^2 and ∂rgθθ=2r\partial_r g_{\theta\theta} = 2r. So Γrθθ=12⋅1r2⋅2r=1r\Gamma^\theta_{r\theta} = \frac{1}{2}\cdot\frac{1}{r^2}\cdot 2r = \frac{1}{r}.
  3. Write the geodesic equations. The rr equation is r¨−rθ˙2=0\ddot{r} - r\dot{\theta}^2 = 0, and the θ\theta equation is θ¨+2rr˙θ˙=0\ddot{\theta} + \frac{2}{r}\dot{r}\dot{\theta} = 0. The factor 2 appears because the pairs (r,θ)(r, \theta) and (θ,r)(\theta, r) both contribute.
  4. Test the straight line through the origin, θ=0\theta = 0 and r=tr = t. Then θ˙=0\dot{\theta} = 0, θ¨=0\ddot{\theta} = 0, r¨=0\ddot{r} = 0. Both equations hold: 0−0=00 - 0 = 0 and 0+0=00 + 0 = 0.
  5. Test the circle of radius 1, r=1r = 1 and θ=t\theta = t. Then r¨=0\ddot{r} = 0 and θ˙=1\dot{\theta} = 1, so the rr equation gives 0−1⋅1=−10 - 1 \cdot 1 = -1. That is not zero, so the circle is not a geodesic.

Interpretation: the straight line is a geodesic and the circle is not, even though both are curves on the same flat plane. Answer: the line through the origin is a geodesic; the unit circle is not.

Example
3. The equator and a latitude circle on a sphere

Use the unit sphere with polar angle θ\theta measured from the north pole and azimuth φ\varphi, so the metric is dθ2+sin⁡2θ dφ2d\theta^2 + \sin^2\theta\, d\varphi^2. Its Christoffel symbols give the geodesic equations

θ¨−sin⁡θcos⁡θ φ˙2=0,φ¨+2cot⁡θ θ˙φ˙=0.\ddot{\theta} - \sin\theta\cos\theta\,\dot{\varphi}^2 = 0, \qquad \ddot{\varphi} + 2\cot\theta\,\dot{\theta}\dot{\varphi} = 0.

  1. Test the equator, θ=π/2\theta = \pi/2 and φ=t\varphi = t. Then θ¨=0\ddot{\theta} = 0, and sin⁡θcos⁡θ=1⋅0=0\sin\theta\cos\theta = 1 \cdot 0 = 0. The first equation gives 0−0=00 - 0 = 0.
  2. Check the second equation: θ˙=0\dot{\theta} = 0, so the φ\varphi equation gives φ¨=0\ddot{\varphi} = 0, which holds for constant speed φ˙=1\dot{\varphi} = 1.
  3. The equator is therefore a geodesic. It is a great circle, the largest kind of circle on a sphere, and it is locally the shortest path.
  4. Length of the equator arc from longitude 0 to longitude 90 degrees: the arc is π2\frac{\pi}{2} radians of a circle of radius RR, so its length is π2R\frac{\pi}{2} R. With R=6371R = 6371 km, this is about 10,000 km.

Try it: test the latitude circle θ=π/3\theta = \pi/3 on the unit sphere with φ˙=1\dot{\varphi} = 1 and φ=t\varphi = t. Is it a geodesic?

Answer: No. Here θ¨=0\ddot{\theta} = 0, so the first equation gives 0−sin⁡(π/3)cos⁡(π/3)=−32⋅12=−34≠00 - \sin(\pi/3)\cos(\pi/3) = -\frac{\sqrt{3}}{2}\cdot\frac{1}{2} = -\frac{\sqrt{3}}{4} \neq 0. One failing equation is enough. The latitude circle is not a great circle, so it is not locally shortest.

Common mistakes and tradeoffs

It is tempting to think a geodesic is always the shortest path between two points. In fact it is only locally shortest. On a sphere, the great circle that goes the long way round between two points is a geodesic, but it is not the shortest path between them. The short arc of the same great circle is the shortest path, and it is also a geodesic.

It is tempting to think a geodesic is a straight line. In fact on a curved surface it is the straightest path in the sense that it never turns relative to the surface. On a flat map of the sphere, a great circle looks curved, and the flat-map straight line is not a geodesic. The word "straight" only has meaning in the surface's own geometry.

It is tempting to think that gravity pulls an object off its geodesic. In fact, in general relativity, a freely falling object follows a geodesic and feels no force. The feeling of weight comes from the floor, which stops you following your geodesic into the ground.

Use the geodesic equation when the space is curved and the object is free, or when you want the shortest route on a surface. Do not use it when a non-gravitational force acts on the object, since that force must be added to the equation. The Christoffel symbols depend on the coordinates chosen, so the individual numbers in the equation change with coordinates, but the geodesics themselves do not. Alternatives exist for special cases. On a flat plane in Cartesian coordinates the answer is just the straight line, and when a surface is given only as a mesh of data, numerical shortest-path methods such as Dijkstra's algorithm are used instead.

History

Geometry on surfaces was studied for centuries, but the modern idea began with Carl Friedrich Gauss in 1827, who showed that a surface can be studied by measuring distances on it, without reference to the space around it. Bernhard Riemann extended this to spaces of any dimension in 1854, and the length of a curve, measured by a metric, became the central object. Elwin Bruno Christoffel introduced the symbols that bear his name in 1869 to write the geodesic equations in any coordinates. Albert Einstein's general relativity, published in 1915 and 1916, made free fall motion along geodesics of spacetime. The idea caught on because it turned gravity from a force into geometry, and the geodesic equation became the working tool of general relativity.

Recap

  • A curve is a geodesic when no nearby curve with the same ends is shorter. You find it by minimising the energy integral EE.
  • The energy trick gives the Euler–Lagrange equation for the metric, which is the geodesic equation with Christoffel symbols.
  • The Christoffel symbols come from the derivatives of the metric; if the metric is constant, geodesics are straight coordinate lines.
  • Free objects in general relativity follow geodesics of spacetime, which is how gravity becomes geometry.

Read next: General Relativity, which uses geodesics for planets and light, and Equivalence Principle, which explains why free fall is the same for every object.

Check yourself

QuestionIn the walkthrough, which of the two candidate paths is shorter, and what are their lengths?Show answer
The straight segment from A=(0,0)A = (0,0) to B=(1,1)B = (1,1) is shorter. Its length is 5≈2.24\sqrt{5} \approx 2.24. The rival that goes first to (1,0)(1, 0) and then up has length 2+1=32 + 1 = 3.
QuestionOn the flat plane in polar coordinates, what is the geodesic equation for θ\theta, and does θ=0\theta = 0, r=tr = t satisfy it?Show answer
The θ\theta equation is θ¨+2rr˙θ˙=0\ddot{\theta} + \frac{2}{r}\dot{r}\dot{\theta} = 0. With θ=0\theta = 0, both θ¨\ddot{\theta} and θ˙\dot{\theta} are zero, so the equation holds.
QuestionCompute the length of a curve with constant velocity (a,b)=(2,0)(a, b) = (2, 0) for time 1 on a sheet with g11=4g_{11} = 4, g22=1g_{22} = 1.Show answer
The squared speed is 4⋅22=164 \cdot 2^2 = 16, so the speed is 4. Over time 1 the length is 4.
QuestionWhy does a freely falling object follow a geodesic with no force acting on it, while a stone you throw up does not?Show answer
In general relativity a freely falling object is on a geodesic of spacetime, and no force acts on it. A thrown stone is pushed by your hand and slowed by the air, and those forces take it off a free path.
QuestionIs every great circle of a sphere a geodesic of that sphere, and is every geodesic of the sphere part of a great circle?Show answer
Yes to both. A great circle is a circle whose centre is the centre of the sphere, and it is a geodesic. Every geodesic of a sphere is a piece of some great circle, so the geodesics of the sphere are exactly the great circles.

Sources