---
title: "Gravity-Assist Mission Designer Interactive Lab | Sandbox Physics"
description: "How can a flyby change speed without an engine burn? By swinging around a planet that is itself moving. Relative to the planet, the spacecraft leaves exactly as fast as it arrived; the flyby only turns its direction. Add the planet's velocity around the Sun to the incoming and outgoing velocities, and the two speeds relative to the Sun differ. The energy the spacecraft gains or loses is traded with the planet's orbit."
canonical_url: "https://sandboxphysics.com/labs/gravity-assist/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/gravity-assist/"
last_modified: "2026-10-22"
---

M079 · Hyperbolic encounter / design

# Gravity-Assist Mission Designer

**How can a flyby change speed without an engine burn?** By swinging around a planet that is itself moving. Relative to the planet, the spacecraft leaves exactly as fast as it arrived; the flyby only turns its direction. Add the planet's velocity around the Sun to the incoming and outgoing velocities, and the two speeds relative to the Sun differ. The energy the spacecraft gains or loses is traded with the planet's orbit.

Aim a hyperbolic flyby past Earth or Jupiter. Drag the periapsis, reverse the turn and switch reference frames, and see how the actual trajectory relates to the asymptotic velocity triangle, the energy exchanged and a safe target for the outgoing speed.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The encounter is planar and unpowered, modeled with patched conics around a spherical body. The planet moves at constant velocity and the spacecraft’s mass is negligible. Atmosphere, tides, oblateness, solar acceleration and ephemeris data are not included. The plotted coast ends at a finite observation boundary, while the asymptotic vectors are taken at infinity. If the path touches the surface, it stops and no outgoing result is reported. The safety altitude is a design margin you choose, not a certified atmospheric boundary.

Physics tutorial

## Energy exchange is visible in the velocity triangle

**Background** A spacecraft falls toward a moving planet, swings around it and flies away. In this local two-body encounter the spacecraft’s energy is conserved, but that is its energy in the planet’s frame.

**Why it matters** The unpowered hyperbolic turn and the patched-conic construction at the asymptotes follow NASA trajectory-design references. The teaching model here is limited to a finite local path, a planet moving at constant speed and a safety margin you choose.

Start with the essentials

- **Focus question**: Can one unpowered encounter gain or lose speed depending on which side it passes?
- **One-sentence intuition**: The flyby only rotates the velocity relative to the planet, so the asymptotic speed in the planet frame stays the same. Adding the planet’s velocity to the incoming and outgoing vectors, which point in different directions, gives two different inertial speeds, and the difference is orbital energy exchanged with the planet.

### Core mathematical model

#### The same velocity in two frames

$$
\mathbf V_{\rm in}=\mathbf V_p+\mathbf v_{\infty,\rm in},\qquad\mathbf V_{\rm out}=\mathbf V_p+\mathbf v_{\infty,\rm out}
$$

Capital letters are velocities in inertial coordinates; the excess vectors are the asymptotic velocities relative to the planet. The planet’s velocity is held constant throughout this local encounter.

#### A hyperbola fixes the turn

$$
e_h=1+\frac{r_pv_\infty^2}{\mu_p},\qquad\delta=2\arcsin\frac{1}{e_h}
$$

At a fixed incoming excess speed, a closer periapsis bends the path more. The sign of the turn decides which side of the planet the spacecraft passes.

#### Aim with an impact parameter

$$
b=r_p\sqrt{1+\frac{2\mu_p}{r_pv_\infty^2}},\qquad v_p=\sqrt{v_\infty^2+\frac{2\mu_p}{r_p}}
$$

The impact parameter is how far the incoming asymptote is offset, not the closest distance. At periapsis the spacecraft moves faster than its asymptotic speed.

#### Without thrust, the excess speed is unchanged

$$
|\mathbf v_{\infty,\rm out}|=|\mathbf v_{\infty,\rm in}|,\qquad\varepsilon_p=\frac{v^2}{2}-\frac{\mu_p}{r}=\frac{v_\infty^2}{2}
$$

Relative to the planet, the speed rises and then falls along the finite path. Only the two asymptotic speeds are equal.

#### Where the exchanged energy comes from

$$
\Delta\varepsilon_{\rm inertial}=\frac{V_{\rm out}^2-V_{\rm in}^2}{2}=\mathbf V_p\cdot(\mathbf v_{\infty,\rm out}-\mathbf v_{\infty,\rm in})
$$

The moving planet gives orbital energy to the spacecraft or takes it away. The planet’s recoil can be ignored only because the spacecraft’s mass is neglected. The turn can also lower the inertial speed.

#### Hit a speed target safely

$$
r_p>R_p,\quad r_p\ge r_{\rm safe}\ge R_p,\qquad |V_{\rm out}-V_{\rm target}|<0.25\,\mathrm{km/s}
$$

This teaching design checks one speed and a safety margin you choose. It does not plan a transfer to a destination. If the path touches or enters the body’s surface, the analytic propagation stops there.

### Common difficulties

#### Faster relative to what?

**Typical misconception** Gravity increases incoming and outgoing planet-relative speed.

**Better mental model** The incoming and outgoing excess speeds are equal. The speed changes only in the inertial frame, once the planet’s own velocity is added.

#### Closer is not always better

**Typical misconception** The lowest allowable altitude always maximizes speed gain.

**Better mental model** The energy exchange depends on a dot product of vectors. Turning too far can swing the outgoing velocity past the direction that gives the most speed.

#### The ends of the plot are not at infinity

**Typical misconception** The first plotted speed equals the excess speed.

**Better mental model** Gravity still acts at both ends of the plotted path. The velocity triangle uses the asymptotic values, while the speed history shows local speeds.

#### A crash has no outgoing flyby

**Typical misconception** A mathematical hyperbola can pass through the planet and still count as success.

**Better mental model** The record stops where the path first meets the surface, and no outgoing result is given. A safety margin you choose can also reject a path that does not hit the planet.

### Run the experiment

1. 01

   #### Compare frames

   Acquire the gain preset, then select inertial coordinates.

   **What to observe:** The encounter keeps the same energy in the planet frame, while the moving planet changes the spacecraft’s inertial velocity.

2. 02

   #### Reverse the exchange

   Compare the gain and loss presets at the same radius.

   **What to observe:** The excess speed is the same, but the outgoing inertial speed depends on which way the path turns.

3. 03

   #### Design safely

   Drag periapsis and adjust the outgoing scalar speed target; inspect the trade chart.

   **What to observe:** Only encounters that miss the planet and stay outside the safety margin can pass the speed target. The trade curve can peak somewhere in the middle of the range.

4. 04

   #### Stop an impossible mission

   Compare the unsafe-margin and surface-interception presets.

   **What to observe:** One path comes closer than the chosen margin. The other hits the surface, stops there and has no outgoing result.

Physical conclusion

Compare observations, conditional fits and conservation diagnostics together.

Motion & dynamics · Starter path

## From a falling ball to an orbit

Start by measuring gravity and splitting motion into components. Then add contact forces and collisions, and follow the same laws all the way to an orbit.

[Start here → **Free Fall & Measuring Gravity** Capture a few drops and fit the camera positions to estimate gravitational acceleration. Then add air damping and watch the fit drift from the truth. Observe · 14 min](https://sandboxphysics.com/labs/free-fall/)

1. [1 Free Fall & Measuring Gravity](https://sandboxphysics.com/labs/free-fall/)
2. [2 Projectile Flight Designer](https://sandboxphysics.com/labs/projectile-flight/)
3. [3 Inclined Plane & Friction](https://sandboxphysics.com/labs/inclined-plane/)
4. [4 One-Dimensional Collision Bench](https://sandboxphysics.com/labs/collision-bench/)
5. [5 Mass–Spring Oscillator](https://sandboxphysics.com/labs/mass-spring/)
6. [6 How Orbits Take Shape](https://sandboxphysics.com/labs/orbit/)

[View the full path →](https://sandboxphysics.com/topics/mechanics/#starter-path)
