Contents

Course 14 · Advanced

Lambert's problem and launch windows

Given two positions and a flight time, find the orbit. The solver behind every interplanetary window.

The transfers so far have been drawn between circles, with the timing left to take care of itself. A real departure for Mars cannot do that. On the morning of launch the Earth is at one definite point on its orbit, and Mars will be at another definite point on the day the vehicle arrives. The transfer has to join those two points, and it has to take exactly the time between those two dates.

Stated precisely: given two position vectors and relative to a central body of gravitational parameter , and a time of flight , find the conic that passes through and reaches exactly later — that is, find the velocity at the start, and with it the velocity on arrival. This is Lambert's problem, after Johann Heinrich Lambert, who found its central theorem in 1761. Gauss solved it again in 1809 to recover the orbits of asteroids from two sightings.

It is hard for a reason worth naming. Propagating an orbit forward from a position and a velocity is an initial-value problem: Kepler's equation, solved once. Lambert's problem is a boundary-value problem. Both ends are fixed in position and neither in velocity, the time of flight is a transcendental function of the orbit, and the answer is not unique. It has one solution in each sense of motion, more if the vehicle may go round more than once, and a singularity where the two points lie on opposite sides of the Sun. Every interplanetary launch window starts as thousands of these problems, solved one after another.

Two points and a clock

Before any algebra, count. The vehicle's orbit lies in a plane, and the plane has to contain the Sun and both points, so unless the points are exactly opposite each other the plane is decided already. Inside that plane, a conic with the Sun at a focus takes three numbers to describe: its size, its eccentricity and the direction of its periapsis. Requiring it to pass through two given points uses up two of them. What is left is a one-parameter family of conics through both points.

The family runs from one extreme to the other. At one end is a hyperbola so fast it is nearly the straight chord between the points. At the other are ellipses so large and slow that the vehicle drifts out and falls back. Between them sits one conic with the least energy of all, the minimum-energy ellipse. Every member of the family takes a different time to fly the arc. The time of flight picks one.

So Lambert's problem is a search along a single parameter for the member whose time of flight equals . The work is in choosing that parameter well, because the obvious one behaves badly.

Lambert's theorem

Put the Sun at the focus, the departure point at distance and the arrival point at , with the transfer angle between them measured in the direction of motion. Two lengths describe the triangle they make with the Sun: the chord between the points and the triangle's semi-perimeter,

Lambert's theorem says that the time to fly between the points on a conic of semi-major axis depends only on , on and on — not on the eccentricity and not on how the conic is turned. It is not obvious, and the proof is short enough to give.

A proof for the ellipse

Write the two points with their eccentric anomalies and on an ellipse of semi-major axis and eccentricity . In the orbit's own frame a point is at , with , and its distance from the focus is . Name the mean and the half-difference of the two anomalies, and . Three lines of trigonometry give

and Kepler's equation, written at both ends and subtracted, gives the time:

The eccentricity and appear only in the product — the square root in is . That is the whole theorem, waiting to be noticed. Define two angles and by

and the three lines become

Adding and subtracting the first two,

so and are fixed by , and , and so is the time. In the form Lagrange gave it, with whole revolutions added,

Two sign conventions cover the other geometries. When the transfer angle is more than 180°, changes sign. And for every there are two ellipses through the points, one with the empty focus on each side of the chord; the second is reached by replacing with .

Why it is a root-find, and why is the wrong variable

The smallest ellipse that reaches both points is the one where first touches 1: , the minimum-energy ellipse, with . Below there is no ellipse at all. Above it there are two for each — the two positions of the empty focus — with different times of flight. The time of flight is therefore a double-valued function of , with its two branches meeting at . A root-finder asked to find from does not know which branch it is on, and near its derivative vanishes.

At the fast end the family passes through a parabola, whose time Euler found in closed form:

with the minus sign for transfer angles under 180°. Anything faster than is a hyperbola.

The modern cure is to change variable. Izzo's 2014 formulation, which the simulator uses, describes the geometry by one number,

negative when the transfer angle is more than 180°, and labels each conic by a free variable : for an ellipse, with negative on the slow branch and positive on the fast one, for the parabola, and for a hyperbola. The minimum-energy ellipse is . Time is made dimensionless as , and for an ellipse

For this falls steadily from infinity at to zero as grows. A monotone function has exactly one root, so the zero-revolution problem always has exactly one solution in each sense of motion, whatever the time of flight. For the term sends to infinity at both ends, so each multi-revolution branch has a minimum time : below it no -revolution transfer exists, above it there are exactly two.

Figure · Lambert as a root-find

205 °
310 d
04008001200-1-0.500.511.5TIME OF FLIGHT · DAYSIZZO'S xMIN ENERGYPARABOLA1 REV · MIN 740 D2 REV · MIN 1259 D0 REV
r₁r₂c
SOLUTIONS
1
CHORD c
2.467 AU
λ
−0.107
MINIMUM-ENERGY TIME
255 d
PARABOLIC TIME
108 d
ZERO-REV, TYPE II
x −0.142 · a 1.273 AU
ONE-REV
none below 740 d
TWO-REV
none below 1259 d
Earth at 1 AU, Mars at 1.524 AU, both on circles; the transfer angle is measured prograde from Earth to Mars. Each curve is the time of flight against Izzo's free variable x — x = 0 is the minimum-energy ellipse, x = 1 the parabola, x > 1 a hyperbola — for zero, one and two whole revolutions. The dashed line is the time of flight asked for; every crossing is a transfer. On the right, the zero-revolution solution is the heavy arc; the one- and two-revolution ellipses are grey, dashed for the root left of the branch's minimum and solid for the root right of it.

Set the transfer angle to 180° and the time to 259 days: the root sits at , AU, which is the Hohmann transfer of the transfers course rediscovered as a special case. Keep the geometry and lengthen the flight. At 310 days the root moves to negative , the slow branch, because the vehicle has more time than the minimum-energy ellipse needs and spends it on a larger orbit. Past 753 days the one-revolution branch dips below the line and two more solutions appear, one on each side of the branch's minimum: two ellipses of different sizes, each of which takes the vehicle once round the Sun before it arrives. Past 1,280 days there are five.

Branches, and the 180° problem

Collect the cases. A transfer of less than 180° is called type I, one of more than 180° type II; one-revolution transfers are sometimes called types III and IV. Fixing the sense of motion as prograde — anticlockwise seen from ecliptic north, the way the planets go — leaves one type I or type II solution, plus two per available revolution. Allowing retrograde motion doubles the list, but nothing leaves Earth for Mars against the planets' motion: the vehicle would have to cancel Earth's 30 km/s first.

The awkward case is a transfer angle of exactly 180°. The two points and the Sun are then on one line, , and the plane of the transfer is undefined. is harmless in the time equation, so the size and shape of the conic are still found; it is its orientation that is lost. Near 180° the orientation is found but is extreme. Mars's orbit is inclined by 1.85° to Earth's, so an arrival point directly opposite the departure point is usually a little above or below the ecliptic, and the only plane through both points and the Sun is steeply tilted. The vehicle has to be thrown into it, and that costs far more than the transfer itself. This is the ridge that runs through every Earth–Mars porkchop plot below.

Solving it well

Izzo's method finds the root by Householder's third-order iteration on , where is the time asked for,

using closed-form expressions for the first three derivatives of . From Izzo's starting guess — built from the parabolic and minimum-energy times, and — it converges in two to four iterations. No bracketing, no branch bookkeeping: the variable does that.

The velocities then follow without further iteration. With , and , the radial components at the two ends are

and the transverse components, in the direction of motion, are and .

Two practical points matter more than elegance. The time equation above loses precision close to the parabola, where is small, so a robust implementation switches forms: Lancaster and Blanchard's away from , Lagrange's in a band near it, and Battin's hypergeometric series right through it. And every solution should be checked by propagating for and measuring how far it lands from : a multi-revolution request below will otherwise converge to nonsense.

A worked example: the 2026 window

The simulator's planner picks a departure from Cape Canaveral at 12:29 UTC on 31 October 2026, into a 310.2-day flight to an arrival on 7 September 2027. Its ephemeris puts the Earth 0.9928 AU from the Sun at departure and Mars 1.5188 AU from it at arrival, 205.09° further round. The transfer is type II.

The geometry:

The minimum-energy ellipse has AU and a time of flight of 252.8 days; the parabola would take 107.3 days. In dimensionless time the flight asked for is

against at minimum energy. The flight is slower than minimum energy, so the root is on the slow branch: Householder's iteration finds in three steps, and

The velocity at departure, less the Earth's own orbital velocity of 29.996 km/s, is the hyperbolic excess the vehicle must leave with: km/s, a departure . The transfer orbit is an ellipse of eccentricity 0.218, from a perihelion of 0.992 AU — essentially the Earth's distance, so the vehicle leaves near its own perihelion, as a Hohmann transfer would — to an aphelion of 1.546 AU, inclined 1.01° to the ecliptic. It meets Mars at a relative speed of 2.571 km/s.

For comparison, the circular, coplanar Hohmann transfer to Mars's mean distance needs and 258.9 days. The real one is a little dearer and seven weeks longer: the planets are not where the idealisation puts them, and the cheapest real departure takes the transfer that suits the actual positions. Transfers and the Oberth effect turns this into the 3.637 km/s injection burn from a 200 km parking orbit.

From one transfer to a porkchop plot

One Lambert solution prices one pair of dates. A window search prices all of them. Lay out departure dates along one axis and times of flight along the other, solve Lambert's problem in every cell, and contour the departure . The result is a porkchop plot, named for the shape its contours make.

Figure · porkchop plot, Earth to Mars

OPPORTUNITY
30 Oct 2026
295 d
100200300400TIME OF FLIGHT · DAYSDEPARTURE DATEAUGSEPOCTNOVDEC2027FEB101215203050TYPE IITYPE I180°
EARTHMARS
DEPARTS
30 Oct 2026
ARRIVES
21 Aug 2027
C₃
9.14 km²/s²
INJECTION FROM 200 KM
3.632 km/s
ARRIVAL v∞
2.70 km/s
TRANSFER
198° · type II
ASYMPTOTE DECLINATION
23.6°
Contours of departure C₃ in km²/s², one Lambert solution per cell (2-day by 5-day grid), from Keplerian elements for both planets. Click or drag on the plot, or use the sliders, to pick a departure date and a time of flight. The dashed line is the 180° transfer: below it the short-way type I valley, above it the long-way type II one. On the right, the Sun at the centre, the transfer arc in the ecliptic, Earth at departure, Mars at arrival, and — ringed — where Mars was on the day of departure. Orange is the injection burn.

The figure solves 7,526 Lambert problems per opportunity, and three features repay a closer look.

  • Two valleys. Below the dashed 180° line lie the type I transfers, faster and shorter; above it the type II, slower and longer. In 2026 the type II valley is the deeper, 9.14 km²/s² against the type I's best of 11.7. In 2035 it is the other way round. Which family wins depends on where Mars is on its eccentric, inclined orbit when the vehicle gets there.
  • The ridge. Along the 180° line the contours crowd together. The positions are nearly opposite, the plane through them is steep, and the climbs into the hundreds. No sensible trajectory crosses it.
  • The window. A launcher does not need the minimum; it needs a at or below what it can deliver. In 2026, a vehicle limited to 10 km²/s² can leave on any day from 20 October to 9 November: three weeks. At 12 km²/s² the season stretches to about ten weeks. That width — how many days are inside the contour the launcher can reach — is what a mission designer means by the launch period.

Departure energy is not the only cost. The arrival , which the readout also shows, is what a capture burn or an entry has to deal with at the far end, and it varies across the valley independently of . The cheapest departure of the 2030–31 opportunity, 22 February 2031, arrives at 5.5 km/s. A flyby does not care; a capture into orbit would pay dearly for it. A real mission design contours both, and often a third: the declination of the departure asymptote, which decides which launch sites can reach the transfer plane at all (latitude, azimuth and the orbits you can reach has the geometry).

Why the windows come round every 26 months

The Earth goes round the Sun at a mean angular rate and Mars at , with days and days. The angle between them changes at the difference of those rates, so the same arrangement recurs after the synodic period

— 25.6 months. For circular, coplanar orbits the cheapest transfer is a Hohmann of 258.9 days, during which Mars moves . To be at the far end of the transfer on arrival, Mars must lead the Earth by at departure. That lead comes round once per synodic period, and between times no amount of propellant helps: the geometry is wrong.

Real windows keep the period and lose the regularity.

Figure · twelve years of Mars windows

28 Oct 2026
0102030BEST C₃ · km²/s²DEPARTURE YEAR20262028203020322034203620389.28.98.27.810.214.9
DEPARTURE
28 Oct 2026
BEST TYPE I
17.1 km²/s² · 226 d
BEST TYPE II
9.2 km²/s² · 298 d
NEXT WINDOW
28 Oct 2026 · 9.2 km²/s² · type II
The cheapest departure C₃ on each date, 2026–2037: ink for type I transfers (under 180°), grey for type II (over 180°), from a Lambert solution every 6 days of flight time between 100 and 478 days. The dips are the launch windows; values above 40 km²/s² are off the top. Faint verticals mark one synodic period, 779.9 days, counted from the first window. Move the date to read both families.

Across 2026 to 2037 the figure finds six opportunities, 765 to 815 days apart — 793 days on average, as the synodic period predicts — but they are not equally good. The best, in April 2033, needs 7.78 km²/s²; the worst, in September 2037, 14.86. Mars's orbit has an eccentricity of 0.093, so its distance from the Sun ranges from 1.38 to 1.67 AU, and an opportunity that meets it near perihelion is a different problem from one that meets it near aphelion. Its 1.85° inclination moves the ridge about and decides whether the cheap transfers sit close to it. The pattern of good and bad windows itself recurs: seven synodic periods, 14.95 years, come within about five weeks of eight Martian years, so the geometry nearly repeats every fifteen years, and less closely every seventeen.

The Moon is the opposite case. It goes round the Earth every 27.3 days and is reachable on most days of the month; what varies from day to day is the time of day at which a given launch site passes through the required plane.

In Vivapse

The solver is lambert(r1, r2, tof, mu, opts) in src/sim/lambert.ts: Izzo's method as described above, with the time of flight in three regimes — Lancaster and Blanchard where , Lagrange's equation between 0.01 and 0.2, Battin's series inside 0.01 — third-order Householder iterations to a tolerance of in at most 30 steps, and the velocity reconstruction. Its options choose a retrograde transfer, a number of revolutions and, for those, the left (slow) or right (fast) branch; it returns null when there is no solution and rejects a multi-revolution request that is faster than its branch allows by checking the residual. Solving, propagating and comparing with agrees to of the distance in the worst case tested, and multi-revolution solutions to about . The same file propagates any conic by universal variables in keplerStep, and prices the ends of a transfer in hyperbolicInjection and hyperbolicCapture.

The window search is findWindows in src/sim/windows.ts. For Mars it lays a grid over the search span — departures roughly every two days, and 48 times of flight from 120 to 400 days — and solves a heliocentric Lambert problem between the Earth's position on each departure date and Mars's on each arrival date, from its own truncated VSOP87 ephemeris precessed to J2000. It asks for the default case only: zero revolutions, prograde. Each cell is priced as the injection from the parking orbit plus, for an orbit or a landing, the capture into a one-sol ellipse with periapsis 250 km; a flyby pays nothing at the far end. The best time of flight for each departure date gives a curve, its local minima within 120 days of each other are merged into one window per opposition, and each is refined by coordinate descent. Only then does the site enter: the planner finds the parking-orbit plane that contains both the pad and the departure asymptote, the moment the Earth's rotation carries the pad through it, the coast to the injection point, and re-solves the transfer at liftoff plus coast so the plan is consistent from pad to arrival. porkchop() in the same file returns the raw grid behind a plot like the one above. A program reads the chosen transfer as fc.plan. Missions and destinations has the whole planner, and the physics model the ephemerides.

The documented limits are worth knowing before trusting a window. The search uses zero-revolution prograde transfers only. Its Mars times of flight stop at 400 days, which excludes some of the long type II solutions in the figures here. A search span with no Mars opposition in it returns poor local minima alongside the real ones — they sort last, but read their . The parking orbit is assumed circular, the daily window is quoted at a ±2° plane tolerance, and the drift of the parking orbit's plane under during the coast is not modelled.

Try it

Open the Mission panel, set the destination to Mars and the arrival to Orbit, launch from Cape Canaveral, and press Find windows. The search covers the next 400 days. While the 2026 season lasts it returns one opportunity: departure on 31 October 2026 at 11:37 UTC, a 310-day cruise, = 9.26 km²/s², and 4,498 m/s in total — 3,637 m/s of injection and 861 m/s of capture at Mars.

Now change the arrival to Flyby and search again. The date stays, but the departure moves to 09:00 and the cruise shortens to 292 days, with = 9.18 km²/s² and 3,633 m/s of injection: slightly cheaper to leave. Nothing about the Earth end has changed. What changed is the price of the far end. The flyby's transfer arrives at 2.72 km/s, where a capture into the same one-sol ellipse would cost 932 m/s; the orbit mission's arrives at 2.57 km/s and captures for 861. The planner gave up 3.5 m/s at departure to save 71 at arrival. On the porkchop figure's 2026 plot, compare the minimum on 30 October at 295 days with 31 October at 310 to see the same trade in the readout: rises from 9.14 to 9.22, and the arrival falls from 2.70 to 2.57 km/s.

Search between seasons and the list changes character: without an opposition inside the 400 days, what comes back are the poor local minima the planner warns about, with in the hundreds. Read the before the date.

What carries forward

A Lambert solution ends where it began: with a vehicle coasting. At the far end it is still moving at the arrival — 2.6 km/s relative to Mars in the example — plus everything the planet's gravity adds on the way in. Getting that to zero is the subject of the last two lessons: on an airless body, powered descent guidance does it all with the engine; on Mars, entry, descent and landing lets the atmosphere do most of it, and discovers how little that atmosphere is.