Analysis

A length counted by the lines that cross it

Throw straight lines at random across a curve and count how often they cross it. The average count, times π times the radius of the target, is the curve's length — for a wiggly closed curve, a spiral or a snowflake alike, with no following of the curve and no derivative anywhere. It is Crofton's formula of 1868, and it measures length the way a map-reader's ruled transparency does.

Worth reading first: The length the derivative never sees · Getting pi by dropping needles on the floor.

Every measurement of length so far in this subject has followed the curve. The staircase that is not the diagonal inscribed polygons along it; the length belongs to the journey integrated the speed of a point travelling it; the length the derivative never sees showed a formula that followed it and missed half. All of them need to know the order of the points — which comes next along the curve.

There is a way to measure length that needs nothing of the kind. Throw straight lines at the curve, at random, and count how many times each one crosses. The average number of crossings is proportional to the length, and the constant of proportionality involves π\pi. Morgan Crofton proved it in 1868, extending a theorem of Cauchy about convex curves, and it is the foundation of a subject — integral geometry — that measures shapes by the lines, planes and other shapes that meet them.

Measuring a closed curve with inlets by throwing lines at it. A curve inside a disc crossed by a sample of random lines with each crossing marked, beside the mean number of crossings and the length it implies against the true length.
Fig. 1 A closed curve with inlets, of length 5.7901, inside the unit disc, and the first 36 of 400 random lines thrown across the disc — direction uniform, distance from the centre uniform — with every crossing marked. The lines cross the curve 1.925 times on average, and Crofton’s formula turns that into a length: π × radius × mean crossings = 6.0476, within 4.4% of the length measured along the curve — found without following the curve at all.

What a random line is

The statement needs a precise meaning for “a line at random”, and there is a natural one. A line in the plane is fixed by two numbers: the direction θ\theta of its normal, from 0 to π\pi, and its signed distance pp from the origin. Choosing θ\theta uniformly and pp uniformly — within whatever range keeps the line crossing a target disc of radius RR — gives lines whose distribution does not change when the whole plane is turned or shifted. That invariance is the reason it is the right choice: a measurement of length that depended on where the origin was, or which way was north, would not be a measurement of length.

With that measure, the set of lines that meet a disc of radius RR has total size 0π2Rdθ=2πR\int_0^\pi 2R\,d\theta = 2\pi R, and Crofton’s formula says that for any curve,

L=120πn(p,θ)dpdθ,L = \tfrac12 \int_0^\pi \int_{-\infty}^{\infty} n(p, \theta)\,dp\,d\theta,

where n(p,θ)n(p, \theta) is the number of times the line (p,θ)(p, \theta) crosses the curve. For a curve inside the disc, the right-hand side is half of 2πR2\pi R times the average number of crossings of a random line that meets the disc, so

L=πR×E[crossings].L = \pi R \times \mathbb{E}[\,\text{crossings}\,].

The figure throws 400 lines at a closed curve inside the unit disc, R=1R = 1. The curve is far from convex — five inlets pinch it towards the centre, and some lines cross it four or six times — but none of that matters. The mean count is 1.925, and π×1.9256.05\pi \times 1.925 \approx 6.05, against a length of 5.79 measured by adding up the curve’s own segments.

Why a segment gives the whole formula

The formula has a proof that fits in a paragraph, and it is worth having, because it shows why π\pi appears. Start with a single straight segment of length \ell. For lines of a fixed direction θ\theta, the ones that cross the segment are those whose distance pp falls within the segment’s shadow on the normal direction — an interval of length sin(θϕ)\ell\,|\sin(\theta - \phi)|, where ϕ\phi is the segment’s own direction. So the inner integral in Crofton’s formula is sin(θϕ)\ell\,|\sin(\theta - \phi)|, and

120πsin(θϕ)dθ=122=.\tfrac12 \int_0^\pi \ell\,|\sin(\theta - \phi)|\,d\theta = \tfrac12 \cdot 2\ell = \ell.

The formula is exactly right for one segment, and the π\pi is the length of the range of directions, which the average of sin|\sin| over it — 2/π2/\pi — converts into a factor of 2.

Everything else follows from adding. Crossings of a polygon are the sums of crossings of its sides, so the formula holds for every polygon. A rectifiable curve is the limit of its inscribed polygons, their lengths converge to its length, and — with a little care about lines that pass through vertices, which have measure zero — their crossing counts converge too. So Crofton’s formula holds for every curve that has a length, and it assigns infinity to every curve that does not.

Two curves, two lengths

Measuring a spiral by throwing lines at it. A curve inside a disc crossed by a sample of random lines with each crossing marked, beside the mean number of crossings and the length it implies against the true length.
Fig. 2 A spiral of length 9.0218 inside the unit disc, crossed by the first 36 of 2,000 random lines; the lines cross it 2.824 times on average, and π × 1 × 2.824 = 8.8703, within 1.7% of the length measured along the curve.

A spiral is a harder test, because most of its length is packed near the centre, where a line through the disc crosses many turns at once. With 2,000 lines the mean number of crossings is 2.824 and the estimate is 8.87, against a measured 9.02. The estimate is not systematically off; it is noisy, and the noise is the next thing to look at. Nothing about the spiral’s shape entered the calculation — not its winding, not the way its turns crowd towards the centre, not even the fact that it is a single curve rather than several — and the count would have been just as valid for a scribble.

The count for any one line is a small whole number. What converts it into a length is averaging, and the average of a random quantity settles like any other: its error falls in proportion to one over the square root of the number of samples. That is the same rate the dropped needles settled at, and for the same reason.

Crofton's estimate of a length, line by line. An estimate of a curve's length plotted against the number of random lines used, on a logarithmic axis, with error bands narrowing towards a dashed line at the true length.
Fig. 3 Crofton’s estimate of the length of the closed curve with inlets — π times the mean number of crossings — after 20 to 20,000 random lines, each with a band of two standard errors; the dashed line is the length measured along the curve, 5.7901. The estimate settles on the length and its band narrows like one over the square root of the number of lines: after 20,000 lines it reads 5.7783.

After 20 lines the estimate could be off by a third. After 20,000 it is 5.778, against 5.790, and the band of two standard errors has closed to a few hundredths. Quadrupling the number of lines halves the band. That is slow — each extra correct digit costs a hundred times as many lines — but it is honest, and it does not care how complicated the curve is. Monte Carlo methods trade exactness for exactly this indifference, and the error that does not care how many dimensions shows the same square-root rate holding for integrals in any number of dimensions — the reason the method is used where nothing else works.

The rate can be beaten by throwing lines less randomly. Lines spread evenly over directions and offsets — a grid in the space of lines rather than a random sample — estimate the same integral with an error that falls roughly like one over the number of lines rather than its square root, which is what points too even to be random does for points. Steinhaus’s transparency, below, is such a grid: a few directions, many parallel lines each, and a count that is accurate because it is systematic.

Parallel lines, and a noodle

The lines need not be thrown one at a time. A sheet of paper ruled with parallel lines a distance dd apart, dropped on a curve at a random position and angle, is a whole family of random lines at once — every line of one direction, at every distance spaced dd apart. Crofton’s formula for that family says that the expected number of crossings of a curve of length LL is

E[crossings]=2Lπd.\mathbb{E}[\,\text{crossings}\,] = \frac{2L}{\pi d}.

Buffon's noodle: three shapes of one length, one mean. Three panels, each showing a curve of the same length above a bar chart of how many ruled lines it crosses when dropped at random, with the mean crossing count printed.
Fig. 4 Three curves each of length 1.5 — a straight needle, a circle and a zigzag — each dropped 20,000 times at random on paper ruled with lines 1 apart; the bars show how often each lands on 0, 1, 2, … lines. The distributions differ completely — the circle always crosses 0 or 2, the needle 0, 1 or 2 — yet every mean is within 0.03 of 2L/(πd)=0.95492L/(\pi d) = 0.9549: the average number of crossings depends on the length and nothing else.

For a straight needle of length \ell shorter than dd that is Buffon’s needle problem of 1777, with probability 2/(πd)2\ell/(\pi d) of a crossing. Pi from dropped needles observed that the needle need not be straight — Buffon’s noodle — and the figure puts three shapes side by side: a needle, a circle and a zigzag, all of length 1.5. Their crossing counts have completely different distributions. The circle, whose diameter is less than the spacing, crosses 0 or 2 lines and never 1; the needle crosses 0, 1 or 2; the zigzag occasionally crosses 4 or 5. The means agree to within 0.03, at the value 2×1.5/π2 \times 1.5/\pi.

The distribution of crossings depends on the shape; the mean depends only on the length. Read backwards, that is a measuring instrument. Hugo Steinhaus built one in the 1930s — a transparent sheet ruled with lines in several directions, laid over a map, on which a river’s length is read off by counting how many lines it crosses — and the same principle, under the name stereology, is how the total length of blood vessels in a tissue section or roots in a soil sample is estimated today: count intersections with a test grid, multiply by a constant with a π\pi in it.

A curve too long to measure

The Koch curve's length, measured two ways. Two series of points against stage number from 0 to 6: the Koch curve's exact length and the Crofton estimate from random lines, rising together geometrically.
Fig. 5 The Koch curve across the unit disc at stages 0 to 6: its length, 1.8×(4/3)k1.8 \times (4/3)^k, measured along it (orange), and Crofton’s estimate from 4,000 random lines at each stage (blue). The two grow together — a random line crosses the stage-6 curve 3.33 times on average against 0.58 for the straight segment it started as — and in the limit the mean number of crossings is infinite, which is the curve’s infinite length counted by lines.

The Koch curve replaces every segment by four segments a third as long, so each stage is 43\tfrac43 as long as the one before, and the limit has infinite length. Crofton’s formula sees this without any reference to the construction: a random line crosses the straight segment of stage 0 about 0.58 times, and the stage-6 curve 3.33 times, and the counts track the lengths stage by stage. In the limit a line that crosses the curve at all crosses it infinitely often, the average is infinite, and so is the length.

That is a statement about the curve as a set, and it is one of the formula’s quiet strengths. A curve’s length defined through polygons needs a parametrisation to inscribe along; the count of crossings needs only to know which points of the plane are on the curve. For a curve traced once, the two agree. For a curve that doubles back on itself, counting each crossing point once gives the length of the image — the set of points visited — while counting it once per visit gives the length of the journey, which is exactly the distinction the length belongs to the journey drew between a map and its picture.

Counting points, not visits

The formula counts crossings, and there are two ways to count them when a curve passes through the same point more than once. Count a point once for every time the curve passes through it, and the formula returns the length of the journey — how far a point travelling the curve goes. Count each point of the plane once, however many times it is visited, and the formula returns the length of the image, the set of points the curve covers.

The length belongs to the journey drew three maps with one image and three different lengths, and ended by asking what the image alone determines. Crofton’s formula, counted the second way, is one answer: it measures the image directly, with no map in sight. For a set that is not a curve at all — a tangle of arcs, a tree, a fractal dust — the same count defines a one-dimensional size, and a theorem of Federer says that for every set that can be covered by countably many curves of finite length it agrees with the one-dimensional measure defined by coverings. A tree, which a single curve must traverse twice along each branch, has an image length equal to the sum of its branches and a journey length at least that, and the lines count the first.

The count also shows what cannot be recovered. A set that is invisible to almost every line — met by lines only on a set of directions and offsets of measure zero — has integral-geometric length zero, however large it is in other senses. That possibility is not hypothetical, and it is the subject of the question below.

Convex curves, and Cauchy’s version

For a convex closed curve every line that meets it crosses exactly twice, apart from tangent lines, which are too few to matter. The mean count over lines meeting the curve is then 2, and Crofton’s formula collapses to a statement about how many lines meet the curve at all. For a given direction, those are the lines within the curve’s width in that direction, so

L=120π2w(θ)dθ=0πw(θ)dθ=π×(mean width).L = \tfrac12 \int_0^\pi 2\,w(\theta)\,d\theta = \int_0^\pi w(\theta)\,d\theta = \pi \times \text{(mean width)}.

That is Cauchy’s formula for the perimeter of a convex body, which the shape described from outside derives from the support function, and it has Barbier’s theorem as an instant corollary: every curve of constant width ww has perimeter πw\pi w, the Reuleaux triangle exactly as much as the circle. Crofton’s contribution was to drop convexity, at the price of counting crossings instead of merely asking whether a line meets the curve. For the closed curve with inlets the price is visible: a line through an inlet crosses four or six times, and a formula that only asked whether each line met the curve would measure the convex hull — the curve with every inlet bridged over — and report a shorter perimeter.

What the lines and counts cannot show

The estimates are random, and so are their errors. Every crossing was computed exactly from coordinates — each line tested against each segment of the curve — but which lines were thrown is a seeded random choice, and a different seed gives a different estimate. The figures report the error band honestly; they do not make the estimate exact.

The curves are polygons. The closed curve with inlets and the spiral are drawn with 1,200 segments each, and the “measured” lengths are the lengths of those polygons, which differ from the smooth curves’ lengths in the fifth or sixth digit. The comparison is between two estimates of the same polygon’s length, one by adding its sides and one by counting crossings, and it tests Crofton’s formula rather than the approximation.

Tangent lines and lines through vertices are ignored. A line that touches the curve without crossing it, or passes exactly through a corner of the polygon, has an ambiguous count; the formula can ignore such lines because they form a set of measure zero among all lines, and a random line hits one with probability zero. A deliberately chosen line can, and the formula says nothing about any single line — only about the average.

And the limit for the Koch curve is argued, not shown. Stage 6 is a polygon of 4,096 segments with a finite length and a finite mean crossing count. That the counts grow without bound follows from the formula and the lengths; no figure can throw lines at the limit itself.

Still open: how fast a Cantor dust disappears

Crofton’s formula has a probabilistic cousin that is far from settled. Take the four-corner Cantor set: divide a square into sixteen and keep the four corner squares, and repeat. The limit has a positive, finite one-dimensional measure — in that sense it has a length — but is so scattered that it is invisible to almost every line — its projection onto almost every direction has length zero. At stage nn the set is a union of 4n4^n small squares, and the probability that Buffon’s needle, dropped near it, lands on one of them — its Favard length, the average length of its projections — tends to zero.

How fast it tends to zero is not known. It is at least a constant times (logn)/n(\log n)/n, and Nazarov, Peres and Volberg proved in 2010 that it is at most n1/6+εn^{-1/6 + \varepsilon} for every ε>0\varepsilon > 0. The truth lies somewhere between a rate like 1/n1/n and a rate like n1/6n^{-1/6}, and the gap is a question about how the projections of a fractal line up in different directions — the same projections whose sum is Crofton’s integral, asked of a set that has no length to recover.

Length as a count

Crofton’s formula replaces a measurement along a curve by a census of the lines across it. It needs no order of points, no derivative and no parametrisation — only the ability to say whether a line meets the curve here, and how many times — and it reduces to Cauchy’s perimeter formula for convex curves and to Buffon’s needle for a single segment on ruled paper. The π\pi in all three is the same π\pi, the measure of the directions a line can point in.

The Koch curve adds one more reading. Its dimension, a dimension that is not a whole number, is about 1.26, and a set of dimension more than 1 always has infinite length — a typical line that meets it meets it in infinitely many points. Length is the right measure for sets of dimension exactly one, and the crossing count is its natural instrument.

When a quantity is hard to measure along an object, look for a family of simple probes and count how the object meets them. Length is the number of crossings with lines, area is the number of points inside a random grid, and the count is often easier to take — by a microscope, a transparent sheet, or a random number generator — than the object is to follow.