The counterweight falls, the beam comes over, and somewhere in the last tenth of a second the sling has to let go. Ten milliseconds early and the stone sails eight metres long. Ten late and it drops eight short.
That is the entire machine. Everything else about a trebuchet — the mass, the arms, the sling, the frame — is settled before the crew arrives. The only decision left is when, and the window to make it in is 4.7 ms.
Nobody can do that. So nobody ever tried.
The window, measured
Stock machine: a 6 m long arm on a 4.5 m axle, 1.5 m of short arm, a 520 kg counterweight on a 1.2 m link, a 10 kg stone on a 6 m sling. It is in the air for 1.4 s before the stone has any business leaving, and this is the band it leaves in:
| release t (s) | arm angle (°) | sling-to-arm (°) | speed (m/s) | elevation (°) | range (m) | flight (s) |
|---|---|---|---|---|---|---|
| 1.050 | 128.7 | 106.9 | 32.3 | 110.3 | −72.9 | 6.18 |
| 1.150 | 112.9 | 90.4 | 36.7 | 94.2 | −27.0 | 7.47 |
| 1.250 | 105.9 | 63.5 | 38.1 | 75.5 | 60.2 | 7.60 |
| 1.350 | 107.8 | 24.1 | 36.6 | 46.5 | 130.5 | 5.81 |
| 1.400 | 112.2 | −1.8 | 35.6 | 19.9 | 104.0 | 3.40 |
| 1.450 | 116.1 | −26.5 | 36.3 | −4.5 | 52.1 | 1.55 |
| 1.550 | 116.8 | −63.2 | 36.9 | −31.4 | 21.4 | 0.66 |
Two things in that table are worth more than the range column.
The first is the speed: it sits between 35 and 38 m/s across the whole band. Where you let go barely changes how hard the stone is thrown. It changes only which way it is pointing — and the elevation column falls 150° in half a second. Releasing is not a power decision. It is an aiming decision made by a part that moves at 0.5° per millisecond.
The second is the arm angle, which moves from 106° to 117° and back over the same stretch. The arm is effectively parked at the top of its swing. All of that 150° of aim change is the sling coming round, which is why a trebuchet’s release is set by the angle between sling and arm and not by anything you could see by looking at the beam.
Two ways to hit anything
The arc peaks at 130.5 m, so every target short of that has two answers: let go early and lob it, or late and flat.
| branch | release t (s) | pin (°) | elevation (°) | apex (m) | flight (s) | height at a 40 m wall | impact (m/s) |
|---|---|---|---|---|---|---|---|
| lob | 1.2497 | 63.54 | 75.5 | 76.5 | 7.61 | 63.2 m | 38.3 |
| flat | 1.4397 | −21.80 | −0.4 | 15.9 | 1.79 | 8.5 m | 38.2 |
Both hit 60 m. Both arrive at the same speed, to a tenth. One of them spends seven and a half seconds in the air and comes down out of the sky at 76 m; the other is a flat line across the field that is still only eight and a half metres up when it reaches the wall at 40 m. Put a twelve-metre wall there and the flat solution is a hole in your own curtain wall — which is what the red stretch in the demo’s coach curve is.
Neither branch is any easier to hit:
| branch | window (ms) | m per ms | window (° of pin) | ms per ° | m per ° |
|---|---|---|---|---|---|
| lob | 4.2 | 0.950 | 1.35 | 3.00 | 2.85 |
| flat | 4.7 | 0.851 | 2.16 | 2.00 | 1.70 |
The hook, and what it is actually for
A trebuchet’s sling has a loop on one end, over an iron hook at the tip of the arm. The hook is bent to an angle. When the sling swings round far enough relative to the arm, the loop slides off. That angle is the only aiming control the crew has, and they set it with a hammer before the shot.
Here is the thing I expected to find and did not: the pin is not more precise than a hand. One degree of hook is 2.0 ms of release time and 1.7 m of range. A smith who can get within half a degree is working to about a millisecond, which is not obviously better than a good reaction.
What it is, is repeatable. Same hook, same geometry, same shot. And when you run the two against each other with the jitter each one really has:
| release | jitter | hits within ±2 m | rate | mean error | sd | worst |
|---|---|---|---|---|---|---|
| hand | σ = 60 ms | 2/120 | 1.7% | 10.20 m | 38.68 m | 71.1 m |
| hand | σ = 30 ms | 8/120 | 6.7% | 5.94 m | 26.25 m | 70.2 m |
| hand | σ = 10 ms | 19/120 | 15.8% | 0.85 m | 9.15 m | 26.1 m |
| pin | σ = 2° | 51/120 | 42.5% | 0.35 m | 3.56 m | 9.2 m |
| pin | σ = 1° | 82/120 | 68.3% | 0.15 m | 1.78 m | 4.9 m |
| pin | σ = 0.5° | 118/120 | 98.3% | 0.07 m | 0.89 m | 2.4 m |
A hand with a ten-millisecond release — which is not a human being, that is about the floor of simple reaction time with no decision in it — loses to a hook set with a two-degree error. Not by a little: 15.8% against 42.5%, and nine metres of scatter against three and a half.
And the pin is triggered by the machine, not by the clock
This is the part that moves it from a tip to a mechanic. Let the stone vary by 3% — a quarry does not hand you the same rock twice — and time the release perfectly for the nominal stone:
| release | hits within ±2 m | rate | mean error | sd |
|---|---|---|---|---|
| hand, perfect timing | 49/120 | 40.8% | 0.02 m | 4.27 m |
| pin, perfectly set | 117/120 | 97.5% | −0.04 m | 0.82 m |
A heavier stone slows the whole swing down, so the clock is now wrong about a machine that has changed underneath it. The hook is not reading a clock. It is reading the angle between the sling and the arm — a quantity on the machine itself — and it fires when that angle is right no matter when the angle arrives. The pin is not a timer. It is a feedback device with no moving parts, and that is the whole of its advantage.
Which is why you can aim it at all
A crew does not know the pin angle for a new target. They guess, shoot, see where it went, and bend the hook. That only works if the thing they are correcting is a bias rather than noise — and that is exactly what the sd column above decides.
Starting 6° off, correcting from where each shot lands, twelve attempts each:
| attempt | hand (σ 60 ms) | pin (σ 0.5°) |
|---|---|---|
| 1 | 2.8 → −36.3 → −1.8 m | 11.3 → 0.4 m |
| 2 | −6.4 → 51.8 → −15.9 m | 10.5 → 0.1 m |
| 3 | −0.3 m | 12.6 → −0.2 m |
| 4 | −32.5 → −26.9 → 64.5 m | 12.2 → −0.7 m |
| 5 | −26.0 → 2.1 → −26.9 m | 12.6 → −0.9 m |
| 6 | 53.8 → −15.3 → 14.4 m | 13.2 → −1.4 m |
| 7 | 46.3 → 2.3 → −44.2 m | 13.0 → −3.8 → 1.3 m |
| 8 | 36.9 → 51.8 → −22.3 m | 12.8 → −2.1 → 0.6 m |
| … | ||
| on target inside three shots: 2/12 | 12/12 |
The pin lands it on the second shot, every time, without exception. The hand’s two successes are both first-shot luck — look at attempt 3, which hit before any correction was applied, and attempt 1, which wandered from +2.8 to −36.3 to −1.8 and learned nothing on the way.
That is the lesson worth carrying out of this: you cannot aim with precision you cannot reproduce. The hand’s average error is fine. Its average error was always fine. An average is not what you shoot with.
Power makes it worse
The obvious upgrade is a bigger counterweight. It does what you want to the range and the exact opposite of what you want to the shot:
| counterweight | ratio to stone | max range | release speed | window (° of pin) | window (ms) | m per ms |
|---|---|---|---|---|---|---|
| 390 kg | 39 | 83.2 m | 27.9 m/s | 3.56° | 10.8 | 0.37 |
| 520 kg | 52 | 131.1 m | 36.1 m/s | 2.16° | 4.7 | 0.85 |
| 700 kg | 70 | 195.0 m | 45.3 m/s | 1.62° | 2.6 | 1.57 |
| 950 kg | 95 | 261.9 m | 55.3 m/s | 1.45° | 2.1 | 1.94 |
| 1300 kg | 130 | 315.6 m | 66.2 m/s | 1.30° | 2.0 | 2.03 |
From 390 kg to 1300 kg is 3.3× the counterweight. It buys 3.8× the range and takes the window from 10.8 ms down to 2.0 ms — a factor of 5.4. The sling sweeps faster, so the same millisecond is worth more metres. Every bit of power you add to a trebuchet makes it harder to aim, and the machine that is easiest to walk onto a target is the weakest one that can reach it.
Where the energy goes
Efficiency here is the stone’s kinetic energy at release over the potential energy the counterweight had to spend:
| counterweight | ratio to stone | budget (J) | stone KE (J) | efficiency | max range |
|---|---|---|---|---|---|
| 130 kg | 13 | 3242 | 488 | 15.0% | 12.1 m |
| 260 kg | 26 | 6484 | 1645 | 25.4% | 37.8 m |
| 520 kg | 52 | 12967 | 6614 | 51.0% | 131.1 m |
| 780 kg | 78 | 19451 | 12150 | 62.5% | 220.7 m |
| 1040 kg | 104 | 25934 | 17176 | 66.2% | 287.6 m |
| 1560 kg | 156 | 38902 | 25965 | 66.7% | 361.3 m |
| 2600 kg | 260 | 64836 | 38834 | 59.9% | 413.6 m |
It climbs to about two thirds and then turns over, and the reason is visible in the counterweight’s own kinetic energy at the moment of release — energy it spent on moving itself, which the stone never sees:
| counterweight | stone’s share of the budget | counterweight’s own KE at release |
|---|---|---|
| 520 kg | 51.0% | 10.7% |
| 1040 kg | 66.2% | 7.0% |
| 1560 kg | 66.7% | 7.3% |
| 2600 kg | 59.9% | 13.5% |
The heaviest one arrives at the bottom still moving, and nearly twice as much of its fall stays with it. The last row is paying double for 14% more range. The stock machine at 52:1 is deliberately on the cheap side of all this.
And the sling, swept at a fixed everything else:
| sling | fraction of the long arm | max range | release speed | elevation there |
|---|---|---|---|---|
| 2 m | 0.33 | 42.0 m | 26.0 m/s | 0.3° |
| 3 m | 0.50 | 89.8 m | 29.8 m/s | 34.0° |
| 4 m | 0.67 | 128.2 m | 36.2 m/s | 40.1° |
| 5 m | 0.83 | 141.5 m | 38.2 m/s | 42.1° |
| 6 m | 1.00 | 131.1 m | 36.4 m/s | 42.7° |
| 7 m | 1.17 | 114.3 m | 33.4 m/s | 45.0° |
| 9 m | 1.50 | 29.9 m | 14.0 m/s | 33.6° |
The folk rule for a trebuchet is “sling about as long as the throwing arm”, and the model puts the peak at 0.83 of it with a gentle shoulder up to 1.0 and a cliff past 1.2. The stock machine sits at 1.00 and gives up 7% of its range for the round number.
Playing it
You set the pin and you fire. The stone goes somewhere. You bend the pin and fire again.
space— fire, and again to load the next stone.←→— the pin, 1° a step; holdshiftfor a tenth. Or drag on the range table at the bottom.c— the coach: the true range-against-pin curve, the stretch of it the wall eats, and the band that actually hits.m— hand on the rope instead of the hook.spacelooses it. Good luck.t— one twelfth speed. In hand mode this is cheating, and it is worth doing once: at 1/12 the window is 56 ms, a hand hits it comfortably, and that is the proof that the problem was never the skill. The machine does not run at 1/12.w— the quarry stops handing you identical stones (±3%).n— a new target.r— forget everything.
The range table under the field starts empty and fills with your own shots, which is what a crew actually had. Two shots with the hook define the line. Twenty with your hand define nothing.
Reuse
src/pin.mjs is a framework-free ES module and draws nothing.
createMachine(opts)— geometry and masses;DEFAULTSis the stock machine.shoot(m, { releaseAt })orshoot(m, { pin })— one shot, start to landing. Returnsrange,release(time, speed, elevation, pin angle, height, KE),flightTime,apex,heightAtWallwithwallX, andefficiency.samples: trueadds the track.solutions(m, { target })— every release time that hits, taggedloborflat.windowAt(m, { t, target, tol })andpinWindow(m, { pin, … })— the same hole, in milliseconds and in degrees of ironwork.compareRelease(m, { t, pin, timingSigma, pinSigma, payloadSigma })— the two tables in the middle of this page.step(m, s, dt)drives it a frame at a time;pinAngle,pouchVelocity,slingTensionandenergyread the state out.dt = 2e-4is the working value and the one every number here uses.scripts/measure.mjsreproduces every table above;scripts/build-curve.mjsregeneratesdemo/curve.mjs.
One shot is about 0.25 s in Node, so a sweep is a coffee and a live curve is out of the question.
How the physics is done, and why that way
The machine is three generalised coordinates — the arm, the counterweight link, the sling — and I did not derive a single equation of motion. The module declares where every mass is as a function of those three numbers and recovers the dynamics from that function numerically:
J = dx/dqby central difference;- the convective term as a second central difference of
x(q + t·q̇)int, which is exactlyq̇ᵀHq̇withq̈held at zero; - then
M q̈ = Jᵀ(F − W c)withM = JᵀWJ, a 3×3 solve per evaluation.
Nine position evaluations per acceleration, four of those per RK4 step. It is perhaps three times the cost of hand-derived equations and it cannot be wrong in the particular way hand-derived equations are usually wrong, which is one sign-flipped term in the Coriolis block that makes everything plausible and nothing correct.
It holds energy to 1.3 × 10⁻⁷ of the total through the whole swing, and the shot is unmoved by a 20× change of timestep:
| dt | max dE (J) | relative | range (m) | release speed (m/s) | min sling tension (N) |
|---|---|---|---|---|---|
| 4e-4 | 3.06e-3 | 1.29e-7 | 69.0603 | 35.93932 | 210.7 |
| 2e-4 | 3.26e-3 | 1.37e-7 | 69.0602 | 35.93932 | 210.4 |
| 1e-4 | 3.06e-3 | 1.29e-7 | 69.0602 | 35.93932 | 210.3 |
| 2e-5 | 9.11e-4 | 3.84e-8 | 69.0603 | 35.93931 | 210.2 |
That last column is the model checking itself: the sling is a rigid link in the coordinates, so it is free to push the stone, which a rope cannot do. It never does — the tension bottoms out at 210 N and stays positive the whole way.
Gotchas
-
The beam is two point masses, and that is exact. A body pinned to a fixed axle can only be felt through its mass, its first moment and its second moment about that axle, so two points matching all three are indistinguishable from a rod. Against a 201-mass discretisation of the same beam: 69.0602 m against 69.0572 m, release speed agreeing to six figures. It is also four times faster.
rodAsTwoPointsis eight lines and the only thing in the module that looks like a trick. -
The stone starts on the ground, which costs a whole second phase. For the first 539 ms the sling is being dragged along the trough and the stone’s height is not free — so that phase runs on two coordinates with the sling angle solved from the ground constraint, and lift-off is detected by asking the three-coordinate system what the stone’s vertical acceleration would be and switching over when it goes positive. Both phases come out of the same solver, which is the only reason this was not a day’s work.
-
Release exactly when asked, not at the next step boundary. The range curve runs at 0.85 m per millisecond; releasing at the next multiple of
dtinstead makes a 4e-4 timestep look like a third of a metre of physics.shoottakes a short final step to land on the requested moment, and the range column above is flat across the whole refinement because of it. -
Correction slopes carry a sign and I got it wrong first. On the flat branch more pin angle means a longer shot; on the lobbed branch it means a shorter one. My first walk-in table diverged beautifully — 11 → 26 → 55 m — because
pinWindowreturnsmetresPerDegreeas a magnitude and I subtracted with it. If you correct a shot from these numbers, take the signed difference of twoshootcalls. -
Drag is on, and it is smaller than it feels. A 10 kg stone of 0.1 m radius at 36 m/s carries 11.6 N of drag against 98 N of weight — 12%. Enough to bring the longest shot off at 42° rather than 45° and to stop the two branches being mirror images, not enough to be the story.
createMachine({ drag: false })turns it off if you want the textbook arc. -
There is no friction in the trough, no wind, no sling stretch, and the stone is a sphere. The first of those is the one I would add next: a real pouch dragging a real stone over real timber loses a few percent before lift-off, and it loses it inconsistently, which is a second argument for the pin that this model does not get to make.
-
demo/carries its own copy of the module and its own baked curve, by contract. If you touchsrc/, re-copy it intodemo/and re-runscripts/build-curve.mjs.




