DEV Community

Surendra Singh Kamboj
Surendra Singh Kamboj

Posted on AI-assisted

Orbital speed, escape speed and the square root of 2: a satellite calculator in JavaScript

The speed a satellite needs to stay in orbit and the speed needed to escape Earth are linked by one number, √2. You can check it in a few lines of JavaScript, and the same code gives the period of the ISS and of a geostationary satellite. (I build PractiSci, which has a free satellite-orbits lab.)

What are the orbital and escape speed formulas?

Orbital speed at height h: v = √(GM/(R + h)). Escape speed: v_esc = √(2GM/(R + h)). Orbital period: T = 2π√((R + h)³/GM).

const G = 6.674e-11, Me = 5.972e24, Re = 6.371e6;
const orbitV = (h) => Math.sqrt(G * Me / (Re + h));
const period = (h) => 2 * Math.PI * Math.sqrt((Re + h) ** 3 / (G * Me));
const escape = (h) => Math.sqrt(2 * G * Me / (Re + h));
Enter fullscreen mode Exit fullscreen mode

What numbers do I get for Earth?

Orbit Orbital speed Period Escape speed
Near the surface 7.91 km/s 1.41 h 11.19 km/s
ISS (400 km) 7.67 km/s 1.54 h 10.85 km/s
Geostationary (35,786 km) 3.07 km/s 23.93 h 4.35 km/s

The ratio escape/orbital is 1.4142 at every height, which is √2. That is why a satellite already has about 70% of the speed it would need to leave Earth altogether.

Why is a geostationary orbit so high?

Its period must equal one sidereal day, 23.93 h. Solving T = 2π√(r³/GM) for r gives r ≈ 42,164 km from the centre of the Earth, which is 35,786 km above the surface. Then the satellite stays over the same point on the equator.

FAQ

Does the mass of the satellite matter?

No. It cancels, so a tiny satellite and a space station at the same height have the same speed.

Why do astronauts feel weightless in orbit?

They are in free fall around the Earth, not beyond gravity. Gravity at 400 km is still about 89% of its surface value.

Where can I try it?

The free satellite orbits lab lets you change the height and see the speed and period, and the work, energy and power guide covers the energy side.

Top comments (0)