A two-stage rocket flies pad to orbit on a live blueprint, max-Q and all.
A generic two-stage launcher flies from an equatorial pad in an Earth-centered inertial frame, integrated with RK4 at a fixed 0.1 second step: inverse-square gravity, an exponential atmosphere that turns with the Earth, drag with a transonic bump, and engines that gain thrust and efficiency as the air thins. It climbs straight up, tips a few degrees east at a chosen speed, then holds zero angle of attack so gravity bends the path over, the reason real rockets tilt. The upper stage steers with a zero-effort-miss law to arrive at the target altitude with no vertical speed just as it reaches orbital speed, while the spent booster falls away on its own ballistic path. The drawing is a true-curvature Earth with altitude exaggerated five times, annotated with leader-line callouts, live altitude, velocity and dynamic pressure graphs, and a dashed fan of what other pitch kicks would have done.
Try it. Drag the sliders (pitch kick, kick speed, target orbit) and watch the dashed prediction update, then press Launch or click the drawing. Too timid a kick lofts the rocket and it falls back; too hard a kick flattens it in thick air until dynamic pressure breaks it. Up and down nudge the kick, left and right the kick speed, B toggles the max-Q throttle-down, D restarts the demo.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build a rocket launch simulator that shows why rockets tilt over on the way to orbit, using JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Make a full-window canvas that stays sharp on high-DPI screens. Use real units: an Earth of radius 6,371 km with GM = 3.986e14, centered below the screen.
- Simulate one point-mass rocket in two dimensions with RK4 at a fixed 0.1 s step. Forces: gravity toward Earth's center, thrust, and drag of 0.5 * rho * v^2 * Cd * area with air density rho = 1.225 * exp(-altitude / 8500).
- Give it two stages with realistic masses, thrust and specific impulse, and burn propellant at thrust / (Isp * 9.81) kg per second. Drop the first stage when it runs dry.
- Guidance: go straight up until 50 m/s, tilt a few degrees east over a few seconds, then always point the thrust along the velocity. Gravity does the turning.
- Draw the Earth as an arc and the trajectory over it, exaggerating altitude about five times so the climb is visible. Track dynamic pressure and mark where it peaks (max-Q).
Once that works, make it beautiful:
- Style it as a blueprint: deep blue paper, a fine grid, thin white line work, dashed reference lines for 100 km, and small leader-line callouts at pitch kick, max-Q, staging and engine cutoff.
- Add altitude, velocity and dynamic pressure graphs against time, and sliders for the pitch kick angle and the speed it happens at.
- Draw a faint fan of trajectories for several kick angles so the sweet spot is obvious.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as closed-loop upper stage guidance that circularizes at a target altitude, Earth's rotation and a co-rotating atmosphere, or a structural limit on dynamic pressure that can break the rocket.