Every curve is a sum of cosines
Assumes A demand that is an equation.
The previous rung ended on a sentence and this one is the arithmetic behind it: a polynomial in the coordinates of a two-link arm’s tip is a finite sum of cosines of whole-number combinations of the arm’s two angles.
It is worth saying at once what that sentence is not. It is not a Fourier series. A Fourier series is an infinite sum that converges to something, and its coefficients are integrals. This sum is finite, its coefficients come out of multiplying two-term expressions together, and it does not converge to the polynomial — it is the polynomial, rearranged.
The arm, and the two expressions to be multiplied
The arm is two links of length from a fixed pivot, at angles and :
Now write and . Then and , and the two coordinates become
Each is a Laurent polynomial in and — a sum of terms with and any whole numbers, positive or negative — with four terms and complex coefficients. And that is the whole trick, because a product of Laurent polynomials is a Laurent polynomial. Multiply by itself, multiply the result by , add up the monomials with their coefficients, and arrives as
with finitely many nonzero , because each multiplication can only spread the exponents by one in each direction.
The exponents are whole numbers because they are added, and nothing anywhere divides them. That is why the frequencies in the final sum are integers, and it is the reason the machinery of the next rungs exists at all: an integer multiple of an angle is something a chain of linkages can produce, and an arbitrary real multiple is not.
Folding the pairs back into cosines
The Laurent form has complex coefficients and the polynomial is real, so the coefficients are not independent. Because on the unit circle, reality forces
and the two halves of each pair add up to a single real cosine. Writing ,
So the whole sum collapses to a constant — the coefficient, which is real on its own — plus one cosine per conjugate pair:
Three quantities per term, and each one is going to become a piece of a machine. and are how many times the two arm angles have to be multiplied up, is a fixed angle a rigid link can carry, and is a length.
Which representative of the pair is kept is arbitrary and it is fixed. The lexicographically positive one, so is stored rather than . That choice makes no difference to the sum and all the difference to reproducibility: two runs of the compiler produce the same machine, term for term and bar for bar, and a machine that changed between builds would make every count in this field meaningless.
The check, and why it is a real one
An identity derived on paper is a claim about arithmetic, and this site’s habit is that a claim gets a test it could fail. The test here is unusually clean, because there are two evaluations that share nothing.
Route one. Take angles and , compute the arm’s tip, put the coordinates into the polynomial, and add up the monomials.
Route two. Take the same angles, compute for each term, take its cosine, scale by the amplitude, and add.
The first never forms a frequency and the second never forms a coordinate. They meet only in the value they produce.
Every bar in that chart is at the floor of double arithmetic. The worst disagreement over all nine curves and twenty-seven hundred angle pairs is , and the curves with the larger figures are the ones with the higher powers, which is what rounding looks like: at a coordinate of size two is a number of order thirty, and thirty times the machine epsilon is about .
That the errors track the powers rather than the term counts is itself evidence. A truncated series would have an error governed by how much was thrown away, and would get worse for the curves whose expansions have more terms. The lemniscate has five terms and the cubic eight, and it is the quintic, with the biggest coordinates raised to the highest power, that reports the largest number. There is nothing being thrown away.
That figure carries a second thing worth noticing, which is what the zeros are. Where the line crosses the axis, the arm’s tip is on the curve — so the crossings are the configurations a compiled machine may occupy at that driving angle. Counting them is counting assemblies, and it is the same count the algebra field makes for a four-bar by eliminating variables, arrived at by looking rather than by resultants.
Worked, on the smallest case that is not trivial
The algebra above is short and it is still algebra, so it is worth watching it happen on one curve.
Take the circle , with unit links. The sum of the two coordinates squared is the squared length of the arm’s tip from the pivot, and the arm is two unit links, so by the cosine rule that squared length is . The circle’s equation therefore becomes
which is a constant of and one cosine term, at frequencies , , with no phase at all.
The machinery produced that without being told any geometry. It squared two four-term Laurent polynomials, added them, and found that fourteen of the sixteen products cancelled — the , , , terms and the cross terms and all vanish between and , leaving only , its conjugate, and the constants. What is left is the cosine rule, arrived at by multiplication rather than by trigonometry.
It is worth pausing on what the single term means as a mechanism, because it is the smallest example of what this whole field does. One cosine term set equal to a constant says is fixed, which says is fixed, which says the angle between the two links does not change. The arm is a rigid body turning about the pivot, and its tip goes round a circle. The compiler, handed a circle, has derived a crank.
That is a good result and it is also the first warning about the method. A crank is one bar and the next rung reports the compiled machine at eleven, because the compiler builds the whole apparatus of arm, angle transport and summing chain whether or not the sum has anything to sum.
The parity, and where the empty half of the lattice goes
The observation that has the parity of the monomial’s degree is easy to state and it does real work, so it deserves a line of its own.
Consider a curve with only even-degree monomials — a conic centred at the origin, say . Every monomial has even total degree, so every term has even, and half the lattice points are empty before any cancellation happens at all. The ellipse’s four terms sit at , , and , and the odd points and — which a line would use — are not merely small, they are structurally absent.
The same argument run the other way says something about curves through the origin. A polynomial with no constant monomial has , so its summing chain has to end on the line through the pivot rather than beside it. That is a geometric statement about the machine derived from a purely algebraic feature of the input, and it has a consequence the compiler had to be taught about: the arm folded back on itself, with its tip exactly at the pivot, is on every such curve at every driving angle. It is a perfectly good solution of the equation and a completely useless configuration of the machine, because a folded arm is a flattened parallelogram and the machine built on it will not move at all.
Three of this field’s nine curves pass through the origin, so that is not an edge case, and the compiler now scores its candidate starting configurations rather than taking the first root a scan finds.
What the identity does and does not say
Three things follow immediately, and one thing does not follow and is worth guarding against.
It follows that the frequencies are bounded by the degree. A monomial can shift an exponent by at most in each of and , so every term of a degree- curve has and . That bounds the angle multiplications the machine has to perform, and the bound is what makes the arithmetic half of a compiled machine cheap.
It follows that the parity is fixed. Each factor of or changes by an odd amount, so the terms coming from a monomial of total degree all have . A polynomial with only even-degree monomials produces only even , which is half the lattice gone.
It follows that the constant is not free. The coefficient is whatever the multiplication produced, and it becomes the position of the line the machine’s summing chain has to end on. A curve through the origin has structure the compiler will meet again.
It does not follow that the sum has few terms. Nothing above says how many of the are nonzero, and that is the whole subject of the next rung. The bound says a degree-five curve uses frequencies no larger than five in each variable, which is a lattice of a hundred and twenty-one points; how many of those survive depends on cancellation, and cancellation depends on the coefficients rather than on the degree.
The unglamorous half: it is a multiplication
It is worth being plain about what the compiler’s front end actually does, because the field’s later rungs are about machines with hundreds of bars and it would be easy to imagine something clever at the start.
There is nothing clever. Two four-term Laurent polynomials are formed once. Each monomial of the input is turned into a product of powers of them, by repeated multiplication. The results are added with the input’s coefficients. Terms smaller than in magnitude are dropped, and the survivors are folded into conjugate pairs. That is the whole of it, and on the largest curve in this field’s catalogue it takes under a millisecond.
The dropping threshold is the one judgement in the procedure and it is an absolute one rather than a relative one, deliberately. The coefficients are formed by multiplying numbers of order one, so a genuine coefficient is of order one and a cancelled one is of order ; there is a dozen decades of daylight between them. The cancellations this rule has to get right are the ones that take a lemniscate from fifteen terms to five, and they are exact rather than nearly exact, because the lemniscate’s symmetry makes them exact.
Why the arm has two equal links
Nothing above required the two links to be the same length, and it is fair to ask what the choice buys.
With unequal links and the coordinates become and the whole derivation goes through unchanged: the Laurent polynomials pick up different coefficients, the products still terminate, and the conjugate pairs still fold. Every term count in this field would be identical, because a term count is about which lattice points survive and the coefficients that cancel are the ones symmetry makes cancel.
What changes is the reachable set. Equal links reach the full disc of radius including its centre; unequal links reach an annulus with a hole of radius in the middle. A curve passing through that hole would be unreachable there for no reason but the choice, and the compiler would report a machine that works on part of the curve and fails on the rest, with nothing in its output saying why.
So equal links are the choice that removes an arbitrary obstruction, and the price is the one paid two sections above: with equal links the folded configuration exists, and it is exactly at the pivot, and every curve through the origin has it as a solution. Both halves of that trade are stated because neither is obvious from the algebra, and a reader who later finds the compiler scoring its starting angles will want to know that the scoring is repairing a consequence of a deliberate choice rather than patching a bug.
Why this is the field’s foundation and not a lemma
Every later rung is downstream of this one in a specific way.
The gadgets exist to produce from and , and they can only do it because and are whole numbers. The summing chain exists to add the terms up, and it can only be a chain of bars because each term is a fixed length at a produced angle. The cost is counted in terms and pairs of terms. The failures are failures of gadgets to produce the angles this identity asks for.
And the check above is the reason it is safe to build all of that. A machine four hundred bars long is not a thing that can be reasoned about position by position, and the only way to trust it is to trust each piece and to have an independent measurement of the whole. The identity is the first piece, it is checked against a route that shares no code with it, and the two agree to fourteen decimal places on every curve tried.
That is the same discipline this site applies to a Jacobian against a finite difference and to Grübler’s count against a rank: not one calculation done carefully, but two calculations done differently, and the distance between them published.
One thing the identity is not evidence about
A caution, because the next several rungs will be quoting fourteen-decimal agreements and it would be easy to let them accumulate into a confidence they do not support.
The identity is about arithmetic. It says that a certain sum of cosines has the same value as a certain polynomial, for every pair of angles. It says nothing whatever about whether a mechanism built from those cosines works, whether it can be assembled, whether it moves, or whether the thing it draws is the curve.
Each of those is a separate question with a separate measurement, and at least two of them have answers that are worse than a reader arriving from this rung would guess. A compiled machine works over a fraction of a turn rather than a whole one — a general quintic’s machine over a tenth of a radian — and it has assemblies that satisfy every bar and draw a different curve entirely.
So the right way to hold this rung is as the first of several independent claims rather than as a foundation that carries the rest. The algebra is exact and it is checked. What is built on the algebra has its own failure modes, and they are not inherited from here; they arrive with the bars.
The identity being a multiplication rather than a discovery is the honest half of the rung, and it is worth saying what that buys, because unglamorous undersells it. An identity that is a multiplication is exact, terminating and checkable term by term: there is no approximation to bound, no series to truncate, and no convergence to argue about. Every coefficient the expansion produces is a finite sum of products of the polynomial’s own coefficients, and a wrong one shows up as a disagreement at a single sampled angle pair rather than as a drift. That is why three hundred random pairs at is a strong check rather than a weak one — the agreement is between two computations of the same finite quantity, so any error at all in either would show. The field is built on it for exactly that reason: the foundation of a construction should be the part with no approximation in it, and everything downstream — the bar counts, the arcs, the transport costs — is then the only place an error can hide.
What this makes readable
Essays that name this one as a prerequisite.
- A circle costs one term The curve as an equation
- Four bars that add two angles The curve as an equation
What links here
Essays that link to this one from their own argument.
- Two circles for the price of one The curve as an equation
- A circle costs one term The curve as an equation
- The price is on the equation The curve as an equation
- Doubling is cheaper than adding The curve as an equation
- Four bars that add two angles The curve as an equation
- Prescribing a curve rather than points The problem backwards
- The machine, compiled The curve as an equation
The objects this essay names
Each one links to every other essay that touches it.
Algebraic curveConjugate pairExact arithmeticFrequency pairLaurent polynomialTrigonometric polynomialTwo-link arm