Push on the corner of a rectangular picture frame and it folds into a diamond. Push on a triangle made of the same sticks and nothing happens. The sticks can be as flimsy as you like. The triangle still holds its shape, and that single fact is why bridges, cranes, roof trusses and bicycle frames are full of triangles.

Try to break a frame

Below is a frame of rigid bars joined by free pins. The two joints on the ground are fixed. Drag any other joint and watch what the rest does. Bars turn red when they are being squeezed or stretched, which means the frame is resisting you.

Bars: 0Free joints: 0

Drag a joint. In bar mode, tap a bar to remove it, or tap two joints to add one.

With the plain square, one drag folds it flat. Add the diagonal and it locks. Now switch to bar mode on the bridge and start removing bars. Some can go without any harm. Others, and you will feel which, turn the whole span into a loose linkage.

Why a triangle cannot fold

A triangle is fixed by its three side lengths. Once you know them there is only one shape it can take, apart from flipping it over. That is the old school fact that two triangles with equal sides are congruent. A four-sided frame is different: four side lengths do not pin down the shape, because the corners can still swing. A square and a thin diamond can have identical sides.

Put another way, every joint can move in two directions, and every bar removes one possible motion by forcing two joints to stay a fixed distance apart. A frame with enough well-placed bars has no motion left. One with too few keeps some, and those leftover motions are exactly how it collapses.

Counting the bars

In 1864 James Clerk Maxwell worked out a counting rule for flat frames: a frame with j joints needs at least 2j − 3 bars to be rigid. The three that are subtracted are the ways the whole frame can slide or turn as one piece, which do not count as folding. A triangle has 3 joints and 3 bars, so 2×3−3 = 3 and it just makes it. A square has 4 joints and only 4 bars, one short of the 5 it needs. The diagonal supplies the fifth.

The count is necessary, not sufficient. Five bars crammed into one corner and none anywhere else would pass the count and still flop. In 1970 Gerard Laman gave the exact test for generic flat frames: the count must hold for the frame as a whole and also for every sub-group of joints inside it. The meter above does not use either shortcut. It checks the actual geometry by finding how many independent motions the current shape allows, so it also catches frames that pass the count but are still floppy.

What bridges do with it

Because a triangulated frame cannot change shape, a load applied at its joints is carried by the bars alone as straight pushes and pulls, either squeezing a bar (compression) or stretching it (tension). Nothing bends. Long thin bars are good at pulling and short stubby ones at pushing, so engineers pick sizes to suit. The Warren truss, patented in 1848 by James Warren and Willoughby Theobald Monzani, is the familiar zig-zag of diagonals between a top and bottom chord, and it is still one of the most common bridge forms. The bridge preset above is built that way.

Triangles are not the only answer. A rectangular frame can be made rigid if its corners are welded or bolted so they resist turning, which is how most buildings and bicycle frames get some of their stiffness. But a joint that has to resist turning is heavier and costlier than a pin and a diagonal, which is why so much structure is still a net of triangles.

Next time you see one

Look at a gate with a diagonal plank, a crane arm, a pylon or the roof frame of a barn. The diagonal is not decoration. It is the one bar that turns a shape that can fold into one that cannot.