São Paulo WorldBallistics Range
Open the range Fire the 2-mile shot
Ballistic Dynamics · exterior ballistics

How the range works

Every round on the range is flown by Ballistic Dynamics, a C++ exterior-ballistics engine compiled to WebAssembly. The page only draws what it returns. This is the full working: the equations, where the numbers come from, how far each model has been checked, and what is still an estimate.

1Overview

A round is a state: its position and velocity in the world, its spin rate and roll angle. Every millisecond the engine advances that state with a fourth-order Runge-Kutta step through the forces on it: drag against the air it is in, gravity, the lift from its spin, and the rotating Earth. Nothing is looked up from a table of drops: a 2-mile shot is about 6,400 steps of the same equations.

dp/dt = v
dv/dt = −K(M) ρ |u| u + g + alift − 2 Ω × v,    u = v − w(p, t)
dspin/dt = ½ ρ |u| S d² Clp spin / Ix p position, v velocity, u velocity through the air (w the wind where the round is), ρ air density, M Mach number, g gravity, Ω the Earth's rotation. The step is fixed at 1 ms whatever your frame rate.

The source is open: github.com/ZRosserMcIntosh/ballistic-dynamics (MIT). The engine's own docs/physics.md and docs/validation.md carry everything below in more detail.

2The air

The air is not the ballistics engine's own: it is Aviation Dynamics' U.S. Standard Atmosphere 1976, the same model that flies the aircraft on this site, compiled into the same WebAssembly module. Your temperature, altitude and humidity become a temperature offset from the standard day and a sea-level pressure whose profile passes through the station; the air then changes along the path as the round climbs and falls.

ρ = (p − e) / (Rd T) + e / (Rv T),   e = RH · es(T)   (Buck 1996)
a = √(γ Rd Tv),   Tv = p / (ρ Rd) Moist air is lighter than dry air at the same pressure and temperature (water vapour is lighter than nitrogen), so humidity lowers drag a little and raises the speed of sound. Density altitude is the standard-day altitude with the same density.

Why it matters: drag is proportional to density. A hot, high, thin day (the 2-mile scenario: 32 °C at 1,500 m, a density altitude near 2,450 m) lets the round keep its speed; a cold morning at sea level does the opposite. Compare Cold morning and Hot afternoon: the same rifle drops about a metre more at 1 km in the cold.

3Drag

Each bullet's drag comes from a published ballistic coefficient scaling a standard drag curve: G7 (a long boat-tail, the shape of modern match bullets) where the maker or Bryan Litz publishes one, G1 otherwise. Both curves are the U.S. Army Ballistic Research Laboratory's, drag coefficient against Mach number from 0 to 5.

BC = m / (i d²)     adrag = ρ u² CD,ref(M) π / (8 BC) i is the form factor: how much draggier the bullet is than the reference shape. Published BCs in lb/in² are multiplied by 703.07 for kg/m². Sierra's stepped BCs (a different value per speed band) are applied as published.

The curve's tall hump is the transonic zone: drag about triples between Mach 0.8 and 1.2. Rounds that go subsonic before the target (the result panel says where) slow less afterwards but drift more in the wind.

LoadMuzzleModel and BCSource
.308 Win 175 gr Sierra MatchKing2600 fpsG7 0.243 (G1 .505/.496/.485)Federal GM308M2; Litz; Sierra
6.5 Creedmoor 140 gr ELD Match2710 fpsG7 0.326Hornady 81500
.338 Lapua Magnum 250 gr Scenar2920 fpsG7 0.320Lapua; Applied Ballistics
6.5 Creedmoor 147 gr ELD Match2695 fpsG7 0.351Hornady 81501 (via GAP Precision)
.408 CheyTac 419 gr solid2752 fpsG1 0.949CheyTac (M200, 1:13 in)
.50 BMG 750 gr A-MAX2820 fpsG1 1.050Hornady
5.56 mm M8553020 fpsG1 0.304Federal XM855
9 mm 124 gr Gold Dot1150 fpsG1 0.134Speer 23618GD

4Wind along the range

The true wind is laid along the range in up to three stretches (near, middle, far third), each with a speed, a direction and gusts: a smooth, seeded variation of the speed and a wander of the direction around them, blended over 20 m at each join so the round never sees a step. The flags show it live: their angle is about 4° per mph from the pole.

The drift a wind gives is not proportional to where it blows: a crosswind near the muzzle turns the round when it has the whole flight ahead of it, so the near wind counts most. That is why calling the average wind misses in Three winds.

The mirage in the scope is drawn from the same air: it boils harder in heat and still air, and leans and runs with the crosswind, the way shooters read it.

5Spin and stability

The rifling spins the round at 2π V / twist: a .308 at 2,600 fps from the M24's 1:11.25 in barrel turns 2,773 times a second. Spin keeps a long bullet pointed forward. How well is the gyroscopic stability factor Sg, from Don Miller's rule with its velocity, temperature and pressure corrections:

Sg = 30 m / (t² d³ l (1 + l²)) · (V / 2800)1/3 · (TF + 460) / 519 · 29.92 / P m grains, t twist in calibres per turn, d diameter in inches, l length in calibres, V fps, T °F, P inHg. Below 1 the round is unstable and tumbles; 1 to 1.4 is marginal; 1.4 to 2.5 is stable; above 2.5 very stable. Downrange Sg follows Sg ∝ spin² / (ρ V² Cmα): it grows as the round slows.

Miller stability calculator

Sg =

6Spin drift

A spinning round whose path curves under gravity does not point straight along it: like a gyroscope it settles with its nose slightly to one side, the yaw of repose (McCoy, Modern Exterior Ballistics, ch. 10). The air pushes on that yaw, and the round drifts: to the right for a right-hand twist. The engine computes it from the physics, not a formula:

αR = −(4 (Iy/Ix) Sg / spin) · (u × a) / |u|²     alift = ½ ρ |u|² S CLα αR / m The overturning moment is taken from Sg itself, so only the inertia ratio Iy/Ix (from the bullet's length) and the lift slope CLα are needed. Both are estimated for the bullet class.

Checked against Bryan Litz's formula from measured data, 1.25 (Sg + 1.2) TOF1.83 inches: the engine lands at 0.79 to 0.98 of it for the five rifle loads, without tuning (at 1,000 yd the .308 drifts 9.4 in against Litz's 11.2).

7Aerodynamic jump

A crosswind at the muzzle meets a round that is pointing along the bore: it starts out yawed into the wind, and its first swing turns the crosswind into a vertical kick. For a right-hand twist a wind from the left drops the shot and a wind from the right lifts it: the nose, yawed right of the airflow by a wind from the left, is swung by the spin clockwise (seen from behind) to point down, and the lift follows the nose (benchrest shooters know it as stringing from 10 o'clock to 4). Until October 2026 this page and the engine had the sign the wrong way round; an independent audit caught it. The engine applies Litz's published regression:

Y = 0.01 Sg − 0.0024 l + 0.032   MOA per mph of crosswind

8The wobble

Leaving the muzzle, the nose circles the path in two superposed motions, a fast nutation and a slow precession, at frequencies set by the spin and Sg, ωf,s = (Ix spin / 2 Iy)(1 ± √(1 − 1/Sg)), starting from the crosswind yaw and damping out within a fraction of a second. In bullet time the round is drawn with it, together with the yaw of repose and its real spin (the rifling's engraving turns with it).

9Coriolis and Eötvös

The range turns with the Earth while the round is in the air. In the range's frame that is an acceleration −2 Ω × v, with the Earth's rotation Ω = ω (0, cos φ, sin φ) at latitude φ:

With drag the sideways Coriolis drift is less than the textbook ω sin φ · X · T: drag damps the sideways velocity too, and the slow end of the flight weighs most. The engine's 3-D result matches the exact lateral equation to 0.3 % (a .50 BMG at 2,000 yd, 45° N: 10.2 in, not 11.5).

10Zero, dope and the call

Every rifle is zeroed at 100 m: the engine finds the bore angle that crosses the line of sight there. Your dope is the elevation and wind hold for the target, solved by flying the round through the wind you call (and, if ticked, with spin and Coriolis). The elevation is dialled; the wind is held on the reticle (the red ring shows where to put the target). The shot is then fired through the true wind, with its gusts at that instant. The difference between the call and the truth is your miss.

Scope and aim are yours. Any scope goes on any rifle:

By default each rifle wears its own: the Mosin the PU, the SVD the PSO-1, the 5.56 rifle the ACOG, the rest a mil scope. The dope card speaks the scope's language: mils or MOA to dial, a drum mark and a hold, or an ACOG mark and a hold.

In Assisted aim, the dope for your wind call is set and held for you: dialled, or drummed, or held on the marks. The view shows the sight picture: the crosshair where the shooter puts it, and the red ring on the target's centre.

In Manual aim you do it:

Dial the dope sets the elevation from your card and leaves the wind to you. A dashed ring can show where the call says to aim. The shot leaves at the zero plus the turrets plus where the crosshair is.

The ACOG is not dialled for range. Its illuminated chevron's tip is the 100 m zero, and the bars below it are for 400 to 800 m. Each bar is as wide as a man's shoulders (19 in) at its range, so it also tells you the range. The engine places the bars from this load's trajectory in standard air; the real reticle is engraved for M855 from a 20 in barrel. The 7° field is published. The chevron's size and the ¼ MOA clicks are estimated.

The Soviet scopes. The Mosin M91/30 wears the 3.5× PU (1940) and the SVD the 4× PSO-1 (1964). Neither dials in mils. The elevation drum is engraved in hundreds of metres (PU 1 to 13, PSO-1 1 to 10), and holds are read in thousandths, 1/6000 of a circle (1.047 mrad). The engine engraves each drum for its own load in the firing tables' normal conditions: 15 °C, 750 mmHg and still air. Your dope is the nearest drum mark, plus what the day's air and wind leave over, held on the reticle. The PU has no scales: it shows a pointed post, whose tip is the aim point, between two heavy bars, and everything beyond the drum is held by eye. The PSO-1 has the aiming chevron; three chevrons below it for 1,100, 1,200 and 1,300 m with the drum on 10, which the engine places from the 7N1's own trajectory; a wind and lead scale with a mark every thousandth out to 10 each side; and, bottom left, a rangefinder that fits a 1.7 m man between its base line and the curve at 200 to 1,000 m. The PSO-1's 6° field is published. The PU's 4.5° field and both reticles' line widths are estimated from photographs.

11Bullet time

Slow motion never changes the physics. The engine flies the whole shot first, in its fixed 1 ms steps; the page then shows it at any speed. Between steps the round's state comes from a cubic Hermite interpolation of the step states (positions and velocities at both ends), within 20 µm of a run with steps twenty times finer, so a camera at 1/1,000 speed sees the round glide, never jump. In Bullet time the speed follows the round: slow out of the muzzle, up towards real time down the range (never faster: a 6-second flight takes at least 7 s), then down to about 1/2,500 for the last metres.

Many rounds at once. Fire again while a round is still in the air, and the next one goes too. The engine keeps every round as its own flight, in the air and wind it was fired into, and each flies exactly as it would alone: the engine's tests check this to the last bit. One clock runs the whole range. Bullet time follows the latest round, and the cameras ride with it. A rifle can only fire so fast. A bolt has to be worked (about 1.2 to 1.6 s), while a semi-automatic is ready again in 0.12 to 0.25 s; both figures are estimated. A shot asked for sooner waits its turn, so in bullet time you can press the trigger quickly and the rounds still leave the muzzle at the rifle's real cadence, one after another.

12The trace

A spotter behind the rifle watches the round go downrange: not the bullet, too small and too fast, but its trace, the turbulent wake it leaves, a thin tube of stirred, slower, slightly warmer air that bends the light behind it. The engine sheds that wake along the path every fraction of a metre, where the round was and with its speed and drag then, ages it as the round flies on, and lets the wind carry it. Each stretch spreads as the self-similar far wake of an axisymmetric body (Pope, Turbulent Flows):

θ = √(CDA / 2π)    r½ = a θ (x/θ)1/3    u₀/U = b (x/θ)−2/3,   x = U · age The wake widens as the cube root of its age and fades as its two-thirds power: a .308's trace is a few centimetres wide after 50 m. a and b are estimated at the order of measured values. The page draws it as a refractive tube bending the scene behind it, with a contrast curve (the square root of the strength) so the eye can pick it out, as a spotting scope does; that curve is presentation, not physics.

Tracers are optional, in red (NATO M62 and M856), green (seen on Russian 7.62×54R), orange, yellow or white. The trace lights about 30 m out (the M62 datasheet gives 13 to 140 m). By default it stays lit all the way to the impact, so you can follow any shot to the target. Untick that option to make it burn out by range for each calibre, as real tracers do. The 7.62 NATO figure of at least 775 m is published (RWS M62 datasheet); the others are estimated: 5.56 mm 800 m, 6.5 mm 900 m, 7.62×54R and .338 1,000 m, .408 1,200 m, .50 1,600 m and 9 mm 250 m. Behind the glowing base the page draws the streak the eye keeps, the last 0.07 s of flight. The round flies as the ball load does: tracers are built to match ball out to burnout, and the mass the composition burns off is not modelled.

Hit markers are optional: an X flash on a hit (red when the round reached the dummy), and on the reticle a mark where each of your last six shots went, so you can walk your next shot in. Set them to every impact to see the misses too.

13The dummy and the glass

Choose Crash dummy behind glass as the target (or the Through a windscreen scenario) and a hit opens the impact in the Liquids Lab, where three engines take over from each other:

  1. Ballistic Dynamics (this range) flies the shot and hands over the round as it arrives: its speed, its mass and diameter, and the angle it comes in at (down by the descent angle, sideways by the drift).
  2. Glass Dynamics (the Glass Lab) breaks the pane: the round crushes its way through each ply, tears the interlayer of a laminate, and loses speed doing it.
  3. Liquid Dynamics takes the round through the crash dummy's simulant at what is left of that speed: the entry and exit wounds, the back spatter onto the broken glass and the forward spatter, in bullet time.

The armoured V8. The Rosser V8 from the driving sim, with a crash dummy at the wheel behind its armoured windscreen (32 mm of glass-clad polycarbonate, raked 69.5°, the Glass Lab's layup). The range follows the round from the target plane on to the raked pane and fires it into Glass Dynamics here, at its real angle and with its own mass and radius: the pane stops it, it glances off, or it gets through and the Liquids Lab takes it into the driver. At that rake a round from the front strikes at about 21° to the glass and sees nearly three times the thickness.

A .308 from 600 m, for example, arrives at 497 m/s, leaves the windscreen at 473 m/s and the dummy at 412 m/s. What does not cross over yet: the glass is broken by the Glass Lab's nearest bullet of the same class (its 9 mm, 7.62 mm or .50 ball, at the arriving speed), and the round's yaw and spin at arrival are not handed over. Moving the projectile side of the glass impact into Ballistic Dynamics is that engine's Milestone 8.

14Same shot, every machine

The engine's maths uses only correctly rounded operations: its own exp, log, sin, cos and atan (fdlibm's algorithms), no fused multiply-adds. The same inputs give the same bits on Linux, macOS, Windows and in every browser; continuous integration checks three golden hashes on all of them. That is why a Share link fires exactly the same shot for whoever opens it: the same gust at the same instant, the same impact to the micrometre.

15Validation

CheckReferenceEngine
Six cartridges, drop/drift/speed/time out to 2,000 ydAn independent point-mass solver (py-ballisticcalc)within 0.06 % drop, 0.34 % wind
6.5 CM 140 ELD-M, 200–400 ydLoadDevelopment.com: −3.8 / −13.4 / −29.6 in−3.77 / −13.42 / −29.65
.308 175 SMK at 1,000 ydLong Range Science: 11.67 mil, 2.99 mil in 10 mph12.00, 3.12 mil (+3–4 %, the chart's atmosphere is unstated)
.50 BMG A-MAX drift at 1,000 yd, 10 mphField Ethos: 34 in35.3 in
Spin drift, five rifle loadsLitz's measured-data formula0.79–0.98 of it
Coriolis and EötvösClosed forms; the exact lateral equation0.1 %; 0.3 %
Standard air, moist air, station readingsUSSA-1976, ideal gas, Buckexact to 1e-9 (density)

16What is estimated

estimated The lift slope, the inertia ratio and the roll damping behind spin drift are typical values for the bullet class, not measured for each bullet; the bullet lengths too. The spin drift lands within about 20 % of Litz.
not yet Every round of a load is the same round: muzzle-velocity spread, powder temperature (the temperature here changes the air, not the powder), ballistic-coefficient spread and group size are the engine's next milestone. Transonic dynamic instability (a stable round starting to wobble as it goes subsonic) is not modelled; gyroscopic instability (too slow a twist) is. The range is flat and the Earth's curvature is left out (0.8 m at 3.2 km).
estimated The 7.62×54R loads use secondary-source BCs: Type L light ball G1 0.338, 7N1 G1 0.411 and G7 0.206, marked "citation needed" where they were found. The Mosin's 865 m/s is the figure usually quoted. The SVD's 830 m/s may belong to the later 7N14. Both rifles' sight heights are estimated, and the PSO-1's offset to the left of the bore is not modelled. Checking against the Soviet firing tables is an open item.
published Every number in the engine's data carries its source; manufacturers' figures came through the pages named in the validation table where the makers' own sites could not be reached from the build.

17References