The curve as an equation

A circle costs one term

A line expands to two cosines, a circle to one, a general conic to six. A lemniscate is degree four and costs five; a general cubic is degree three and costs eight. What a curve costs is not its degree — it is how many frequency pairs its own symmetry fails to cancel.

Assumes Every curve is a sum of cosines.

The expansion turns a polynomial into a finite list of cosines, and the length of that list is what a compiled machine costs. So the obvious question is what governs the length, and the obvious answer — the degree — is wrong in both directions.

Nine curves, counted

What each curve costs, in cosines. Every polynomial in the two arm angles is a constant plus a sum of terms A cos(mα + nβ + φ) with whole-number m and n, and the number of those terms is what a machine has to build. The count is not the degree and not the monomial count: a circle costs one term, a general line two, and a lemniscate — degree four — costs five, fewer than the cubic above it, because its symmetry cancels frequency pairs the cubic keeps. Each row's expansion was checked against a direct evaluation of its own polynomial at random angles, worst disagreement 1.8e-14.
Fig. 1 Every curve in this field’s catalogue, with its degree, how many monomials its polynomial has, and how many cosine terms the expansion leaves. The three columns move independently of one another.

Read the last two columns against the third and nothing lines up.

A line has three monomials and gives two terms. Write ax+by=cax + by = c with unit links and it is a(cosα+cosβ)+b(sinα+sinβ)a(\cos\alpha + \cos\beta) + b(\sin\alpha + \sin\beta), which is a2+b2[cos(αψ)+cos(βψ)]\sqrt{a^2+b^2}\,[\cos(\alpha - \psi) + \cos(\beta - \psi)] for the angle ψ\psi whose tangent is b/ab/a. Two terms, at frequencies (1,0)(1,0) and (0,1)(0,1), with a phase that is the line’s own direction.

A circle has three monomials and gives one. The previous rung worked it: everything cancels but the cosine rule, and x2+y2r2x^2 + y^2 - r^2 becomes 2r2+2cos(αβ)2 - r^2 + 2\cos(\alpha - \beta).

A rectangular hyperbola has two monomials and gives three. Fewer monomials than the circle, three times as many terms.

A parabola has three monomials and gives six — the most expensive conic in the catalogue, and more expensive than the general ellipse beside it, which gives four.

A lemniscate has five monomials and gives five. It is degree four. The general cubic below it, with three monomials, gives eight.

There is no ordering here that the degree explains, and no ordering the monomial count explains either. What is going on is cancellation, and cancellation depends on which coefficients a curve has.

How the term count grows with the degree. A dense polynomial of each degree — every monomial present, nothing cancelling — expanded, and its terms counted. The answer is exactly d² + d at every degree tried: two, six, twelve, twenty, thirty, forty-two. That is the honest worst case, and the catalogue's own curves all sit below it because each of them cancels a different amount. The number matters because the summing chain costs a translator for every pair of terms, so a machine's size goes as the square of this and therefore as the fourth power of the degree.
Fig. 2 The ceiling every one of those curves sits under, measured on dense polynomials.

The lattice, and how much of it survives

The expansion’s parity rule says a degree-dd curve can only use frequency pairs with md|m| \le d, nd|n| \le d. That is a square lattice of (2d+1)2(2d+1)^2 points, halved by the conjugate folding and halved again by parity, so the ceiling for degree dd is roughly d2+dd^2 + d. The question is how many of those points actually carry a nonzero coefficient.

The frequencies a lemniscate asks for. One mark per term of x^4 + 2x^2y^2 + y^4 − 1.2x^2 + 1.2y^2, placed at the whole numbers (m, n) that say how many times the two arm angles enter it, and sized by the amplitude — which is the length of the link the machine builds for it. Only one of each conjugate pair is drawn, because (m, n) and (−m, −n) are the same cosine. The empty places are the content: a curve's cost is how many of these lattice points its coefficients fail to cancel, and every one that survives is a chain of reflectors long enough to multiply an angle by m and by n.
Fig. 3 The lemniscate’s five surviving frequency pairs, on the lattice its degree allows. The empty places are the content: each one is a coefficient that cancelled exactly, and each one is a chain of reflectors the machine does not have to build.
The frequencies a cubic asks for. One mark per term of x^3 − 0.2x − y, placed at the whole numbers (m, n) that say how many times the two arm angles enter it, and sized by the amplitude — which is the length of the link the machine builds for it. Only one of each conjugate pair is drawn, because (m, n) and (−m, −n) are the same cosine. The empty places are the content: a curve's cost is how many of these lattice points its coefficients fail to cancel, and every one that survives is a chain of reflectors long enough to multiply an angle by m and by n.
Fig. 4 The same picture for a cubic, one degree lower and three terms more. Nothing about the two lattices differs except which points survived.

Put the two side by side and the argument is visible without any arithmetic. The lemniscate’s polynomial is (x2+y2)21.2x2+1.2y2(x^2+y^2)^2 - 1.2x^2 + 1.2y^2, and (x2+y2)2(x^2+y^2)^2 is the fourth power of a quantity that already collapsed to a single cosine — so the whole quartic part contributes almost nothing, and what is left is the quadratic tail. The cubic’s x3x^3 has no such structure, and it spreads across the lattice as widely as its degree permits.

Symmetry is what makes coefficients cancel, and a curve with symmetry is cheap. The lemniscate is symmetric about both axes and about the origin; the cubic is symmetric about nothing.

The parabola, which is the surprise

The catalogue holds five conics and they cost one, three, four, six and — for the general ellipse — four. The parabola is the expensive one, and working out why is the clearest available demonstration that the cost is about coefficients.

A parabola is yx2+cy - x^2 + c. The yy contributes the odd pair (1,0)(1,0) and (0,1)(0,1); the x2x^2 contributes the even pairs (2,0)(2,0), (0,2)(0,2), (1,1)(1,1), (1,1)(1,-1) and a constant. Nothing cancels between them, because they have different parities and cannot cancel: the parity rule that empties half the lattice for a curve of uniform degree does the opposite here, guaranteeing that the two halves live in different places and neither can annihilate the other.

The frequencies a parabola asks for. One mark per term of  − x^2 + y + 0.6, placed at the whole numbers (m, n) that say how many times the two arm angles enter it, and sized by the amplitude — which is the length of the link the machine builds for it. Only one of each conjugate pair is drawn, because (m, n) and (−m, −n) are the same cosine. The empty places are the content: a curve's cost is how many of these lattice points its coefficients fail to cancel, and every one that survives is a chain of reflectors long enough to multiply an angle by m and by n.
Fig. 5 The parabola’s lattice. The odd pair from the yy and the even pairs from the x2x^2 sit on different sublattices, so every one of the six survives — the parity rule that empties half the lattice for a homogeneous curve is here the reason nothing cancels.

Compare the ellipse, x2+2.2y21.6x^2 + 2.2y^2 - 1.6. Every monomial is even, so everything lands on the even sublattice and the x2x^2 and y2y^2 contributions overlap at four points and cancel at two: the (1,1)(1,1) and (1,1)(1,-1) coefficients survive only because the two squares have unequal coefficients. Make them equal and it is a circle and three more terms vanish.

The frequencies an ellipse asks for. One mark per term of x^2 + 2.2y^2 − 1.6, placed at the whole numbers (m, n) that say how many times the two arm angles enter it, and sized by the amplitude — which is the length of the link the machine builds for it. Only one of each conjugate pair is drawn, because (m, n) and (−m, −n) are the same cosine. The empty places are the content: a curve's cost is how many of these lattice points its coefficients fail to cancel, and every one that survives is a chain of reflectors long enough to multiply an angle by m and by n.
Fig. 6 The ellipse’s, for comparison. Everything is on the even sublattice, the two squares overlap at four places and cancel at two, and what is left is four — with the (1,±1)(1,\pm1) pair surviving only because 1 and 2.2 are different numbers.

So the parabola is expensive because it is inhomogeneous — it mixes degrees — and mixing degrees is exactly what prevents cancellation. A general polynomial of degree dd mixes every degree up to dd, which is why the dense worst case below is what it is.

The dense worst case, measured

A catalogue of nine curves shows that the cost is not the degree. It does not say what the cost is at worst, and for that the honest thing to measure is a dense polynomial: every monomial of every degree up to dd present, with coefficients chosen so that nothing cancels.

Two, six, twelve, twenty, thirty, forty-two — that is d2+dd^2 + d, exactly, at every degree from one to six. It is a clean law and it is also a measurement rather than a derivation: the counts come out of running the expansion and counting what survived, and the formula is what the counts turned out to be.

That number is the ceiling every real curve sits under, and the gap between a curve and its ceiling is the amount of structure it has. A general conic’s ceiling is six and the parabola reaches it; the ellipse cancels two. A general quartic’s ceiling is twenty and the lemniscate uses five.

Why a sparse polynomial is not a cheap one

The most misleading intuition available here is that a polynomial with few monomials will expand to few terms. The hyperbola disposes of it: one monomial, xyxy, and three terms.

The reason is that a single monomial spreads. xyxy is a product of two four-term Laurent polynomials, so it starts with sixteen products, and what survives folding and cancellation is three cosines at (2,0)(2,0), (0,2)(0,2) and (1,1)(1,-1). Nothing about writing the curve compactly made the machine small.

And it runs the other way as well. The lemniscate is written with five monomials and expands to five terms, one apiece — but not the same five, and not by any correspondence. The two counts are measuring different things: monomials count how the curve was written down, terms count how the arm’s angles enter it.

That is worth holding because it is the first place in this field where an obvious proxy fails. The synthesis field has a proxy that works — the number of positions a four-bar can be made to hit is governed by the number of free lengths, and counting the lengths gives the answer. Here there is no such shortcut. To find out what a curve costs, expand it.

What the term count buys, and what it does not

The term count is the input to everything downstream, so it is worth being exact about which costs it governs.

It governs the arithmetic directly. One term is one angle to produce, one phase to apply and one link length to set. The gadgets that do the producing are shared between terms where they can be — the multiples of α\alpha up to dd are computed once and used by every term that needs them — so the arithmetic grows with the term count plus a little.

It governs the carrying quadratically. The terms are summed by a chain, and each term’s direction has to be carried to the vertex before it, one parallelogram at a time. That is N(N1)/2N(N-1)/2 parallelograms for NN terms, and it is what actually makes these machines large. Eighteen terms is a hundred and fifty-three carries.

It does not govern the working arc. How far the machine turns before a gadget hits its singular configuration is a different quantity with a different cause, and the relation between the two is not monotone: the folium, at eleven terms, works over 2.0 radians, and the lemniscate, at five, over 1.3.

It does not govern the sensitivity. How badly a made machine misses its curve when one bar is a hair long turns out to be governed by the reflectors, which are the cheap part.

Bars against terms, over the whole catalogue. One mark per compiled machine. The bar count rises much faster than the term count, and the reason is the summing chain: term k has to have its direction carried to the k−1th vertex of the chain, one parallelogram per hop, so the carrying costs a translator for every pair of terms. Nine curves, from five bars to four hundred and thirteen, on a term count that goes from one to eighteen.
Fig. 7 One mark per compiled machine, bars against terms. Nine curves, from five bars to four hundred and thirteen, on a term count that goes from one to eighteen.

A cost model that is asked rather than predicted

Every bar count quoted in this field is read off a mechanism. The compiler builds the Mechanism object the rest of the site’s solver uses, and the count is the length of its constraint list. Nothing is derived from a formula and compared with reality afterwards.

That is a deliberate choice and it has already caught something. An early version of the compiler produced machines whose Jacobian was rank-deficient by exactly the number of terms on three of the nine curves — a hundred and thirty-four unknowns and a rank of a hundred and twenty-six on the cubic. A formula for the bar count would have reported the same number either way, because the bars were all there; what was wrong was that some of them were collinear, so two of a parallelogram’s constraints had become one equation.

A count taken off the object cannot notice that either, and it did not. What noticed was asking the machine to move and finding that it would not, which is the measurement this site trusts and the reason every claim here gets a test it could fail. The repair was to choose the machine’s starting configuration by scoring how far every parallelogram in it is from flat, rather than taking the first configuration a scan happened to find.

The scoring is arithmetic and not search. The term angles at a candidate start are known in closed form, so the worst pair of parallel directions among them can be computed without building anything; compiling a five-hundred-bar linkage at each of three hundred candidate starts to discover it is singular is the expensive way to learn something the expansion already knows.

The compiler is bad at easy cases, on purpose

The circle is one term and eleven bars, and a circle is drawn by a crank, which is one bar. It is worth being clear about why that is not a defect to be fixed.

The eleven bars are the arm, the parallelogram that carries the second arm angle back to the pivot, the reflectors that make the term’s frequencies, the rigid offset that sets its length, and the one constraint that closes the chain. Every one of those is there because the general procedure needs it. A compiler that noticed the circle’s single term made the summing apparatus unnecessary would be doing case analysis, and case analysis is the thing this construction exists to avoid.

The same point in the other direction: the compiler has no idea that a circle is a circle. It sees a polynomial, multiplies it out, gets one surviving frequency pair, and builds the machine that pair calls for. That the machine turns out to be an arm with a fixed angle at its elbow — which is a rigid body on a pivot, which is a crank — is a consequence of the construction rather than a recognition inside it.

Every universality result has this shape. A procedure that handles the general case handles the easy cases in the general way, which is to say expensively. What it buys is that there is no case it does not handle, and no insight required to handle any of them.

The machine compiled from an ellipse. x^2 + 2.2y^2 − 1.6, compiled: 34 bars and 29 joints, painted by what each part is for. The two-link arm at the pivot carries the tracing point; the reflectors and means build each term's angle; the rigid offsets fix the constant φₖ and the amplitude; the translators carry those directions out along the summing chain, whose last vertex is held on a line. That last constraint is the equation. Every joint drawn is the output of a Newton–Raphson solve on 54 equations, converged to 7.4e-16, and the polynomial at the tracing point is 2.2e-16.
Fig. 8 A machine whose four terms have four different amplitudes: each is the length of one link of the summing chain.

The amplitudes, which are the other half of a term

A term is three numbers and only two of them have been counted so far. The frequencies say which gadgets are needed; the phase is free, because a rigid attachment carries any fixed angle at no extra cost. The amplitude is the length of the link the machine builds, and it has a range worth reporting.

Across this catalogue the amplitudes within a single curve span from 0.0630.063 to 6.36.3 — a factor of a hundred, on the quintic. That is not a problem for the arithmetic, which does not care, and it is a real problem for anything built: a machine with a link a hundred times another’s is a machine whose small links are made to a hundred times the relative precision.

It is also why the amplitudes are drawn on the lattice pictures as mark sizes rather than left out. A term at (3,0)(3,0) with an amplitude of 0.0630.063 costs the same three reflectors as one with an amplitude of six, and contributes a hundredth as much to the equation. The compiler cannot drop it — the equation is exact and every term is in it — but the observation that a compiled machine spends the same effort on terms of wildly different importance is the beginning of the argument that a better construction would approximate, and would not be this one.

Where the cost goes next

The term count is the first of three numbers this field tracks, and the cost rung puts all three together: terms, bars, and the fraction of the bars that are computing anything at all.

The answer there is the one that makes the field’s central point about universality. The arithmetic — the reflectors and means that turn α\alpha and β\beta into mα+nβm\alpha + n\beta — is a small and slowly growing part of a compiled machine. The bulk is parallelograms whose only job is to move a direction from where it was produced to where it is needed, and by the largest machine in this catalogue they are three quarters of it.

So the answer to why is a universality construction so enormous is not that the algebra is hard. The algebra is a few dozen bars. It is that a linkage has no way to refer to a quantity computed somewhere else, and every reference has to be built out of matter.

Sparsity is not a shortcut, and neither is a change of variables

One more thing this rung has to close off, because it is the first idea a reader with an algebra background will reach for.

If the expensive part is the frequency spread, could a change of coordinates make a curve cheaper? Rotate and translate the plane and the polynomial changes; some choices of frame will make coefficients vanish that did not vanish before.

They will, and it does not help much, and the reason is instructive. A rotation of the plane is a shift of both α\alpha and β\beta by the same angle, which changes every term’s phase and no term’s frequencies. Phases are free. A translation is worse than useless: it introduces the translation’s components into every monomial, mixes the degrees, and the parabola’s lesson applies — mixing degrees is what stops cancellation.

So the only frame changes that help are the ones that expose a symmetry the curve already has, and a curve either has a symmetry or it does not. The lemniscate is cheap in its own frame and would be cheap in any frame reached from it by a rotation, and the general cubic is expensive everywhere.

That closes off the obvious optimisation and leaves the honest statement: the cost is a property of the curve, not of how it was written or where it was put. It can be read off in a millisecond and it cannot be argued down.

What a designer would take from this, if anybody built one

Nobody builds these machines, and the rung on exactness is about why. But the cost structure has one consequence that is not about size at all, and it is the practical residue of this rung.

A curve’s cost is a property that can be computed before anything is built. Handed a demand, the expansion says in under a millisecond how many terms it carries, and the term count says within a factor how large the machine will be. That is a very unusual position to be in: the synthesis field cannot tell in advance how well an optimiser will do, and the topology field cannot tell in advance how many chains a census will return without running it.

And the cheapest curves are the symmetric ones, which is the opposite of what the rest of the subject usually finds. A coupler curve with a symmetry is a special case requiring special lengths; a curve to be compiled with a symmetry is a discount. The two fields want opposite things from the same word, and the reason is that one of them is looking for structure in a mechanism it already has and the other is being handed structure and asked what it saves.

What this makes readable

Essays that name this one as a prerequisite.

About the same objects

Not linked from either essay — found by the objects both name.

What links here

Essays that link to this one from their own argument.

The objects this essay names

Each one links to every other essay that touches it.

Algebraic curveCancellationDegreeFrequency pairSparsitySymmetryTrigonometric polynomial