The curve as an equation

Four terms of eighteen draw the quintic

A quintic whose equation costs a compiled machine eighteen terms is drawn to 1.4% of the arm's reach by four of them and to 0.02% by ten, found by trying every set. The four are not its four largest. They are a line through the pivot bent by the square of the radius, the family the cheapest curves come from, and a curve close to that family is nearly free. An ellipse, a parabola, a lemniscate and a folium are not close to it, and each costs its whole equation to come within four per cent.

Assumes The cheapest curves at each degree and Every curve is a sum of cosines.

The cheapest curves at each degree found which curves a compiled machine builds for least. The machine drives a two-link arm whose tip traces a curve. The compiler rewrites the curve’s equation as a sum of cosines of whole-number combinations of the arm’s two angles, and every cosine is a gadget the machine must contain. Searched exhaustively, the cheapest curves at every degree turned out to be concentric circles about the arm’s pivot and lines through it, in the arrangements Chebyshev’s polynomials give: one term at every even degree, two at every odd one.

A designer rarely wants those. A designer has a curve — a cam track, a coupler path, a curve from a catalogue — and the census made a second question askable. How far from that curve is the nearest cheap one? Fix a budget of terms and find the curve with no more than that many that comes closest to the target where the arm can reach. At the target’s own count the distance is nought. Below it the distance is positive, and the distances as the budget falls make a price curve that nobody had drawn.

Exact costs more than close found that for straight-line mechanisms there is nothing between Watt’s four bars at nine per cent and Peaucellier’s seven at exact. The compiler’s price curve turns out to be different, and the difference depends on the curve.

How the nearest curve is found

The search has to be over sets of terms, and it helps that the sets are small. Every curve is a sum of cosines of the arm’s angles, cos⁡(mα+nβ+ϕ)\cos(m\alpha + n\beta + \phi), and each surviving pair (m,n)(m, n) is a term. Because the arm’s two links are the same length, swapping them leaves the tip where it is, so every equation’s amplitude on (m,n)(m, n) equals its amplitude on (n,m)(n, m). The terms come in mirror classes: a pair with its mirror, costing two terms, or a pair on a diagonal that is its own mirror, costing one. A support is a set of classes.

For a chosen support the curves of the target’s degree whose expansion lives inside it are a linear family, since the expansion is linear in the equation’s coefficients. The members are the equations whose amplitudes on every pair outside the support vanish, a null space. Within that family the target is fitted to points of itself inside the reach, by least squares weighted to measure distance rather than equation value. The fitted curve is then measured both ways: the worst distance from the target to it, and from its own points inside the reach back to the target. The second catches a close fit that has grown a stray branch elsewhere in the reach.

Every support within the budget is tried, which is up to several thousand for a quintic, and the price at a budget is the least over all of them. The distances below are quoted as shares of the arm’s reach, which is two link lengths.

Six curves, two kinds of price

The six targets are the catalogue’s conics and higher curves at their own degrees: an ellipse and a parabola of degree two, a cubic and a folium of degree three, a lemniscate of degree four, and a quintic of degree five.

Two catalogue curves are nearly free at a fraction of their terms; four cost their whole equation. For six catalogue curves, the distance inside the arm's reach from each curve to the nearest curve of the same degree built from at most the given number of terms, as a share of the reach, found by trying every set of terms. The ellipse (4 terms): 1, 11%; 2, 11%; 3, 11%. The parabola (6 terms): 1, 75%; 2, 49%; 3, 35%; 4, 35%; 5, 35%. The cubic (8 terms): 1, 89%; 2, 18%; 3, 18%; 4, 0.75%; 5, 0.74%; 6, 0.74%; 7, 0.74%. The folium (11 terms): 1, 96%; 2, 51%; 3, 39%; 4, 29%; 5, 29%; 6, 29%; 7, 18%; 8, 5.2%; 9, 5.2%; 10, 5.2%. The lemniscate (5 terms): 1, 44%; 2, 34%; 3, 34%; 4, 7.9%. The quintic (18 terms): 1, 74%; 2, 21%; 3, 21%; 4, 1.4%; 5, 1.4%; 6, 0.68%; 7, 0.68%; 8, 0.32%; 9, 0.32%; 10, 0.021%. Each curve is exact at its own count, marked by a ring on the floor. The cubic and the quintic fall below one per cent of the reach at four and six terms; the ellipse, parabola, lemniscate and folium stay above four per cent until their last term.
Fig. 1 For six catalogue curves, the distance inside the arm’s reach to the nearest curve of the same degree with at most the given number of terms, as a share of the reach, on a logarithmic scale. Rings on the floor mark each curve’s own count, where it is exact.

The curves split into two kinds, with nothing between them. The cubic’s equation costs eight terms, and its nearest four-term curve is 0.75% of the reach away. The quintic’s costs eighteen, and four bring it to 1.4%, six to 0.68%, eight to 0.32% and ten to 0.021%. For these two the cost of drawing closely is a fraction of the cost of drawing exactly.

The other four stay far until their last term. The ellipse costs four terms and the nearest curve with three is 11% of the reach away. The lemniscate costs five, and four leave 7.9%. The folium costs eleven, and ten leave 5.2%. The parabola costs six, and five leave 35%. For these four, a machine that is not exact is not close either.

Where each catalogue curve's cost sits. For six catalogue curves: degree, the terms the exact equation costs, the fewest terms whose nearest curve comes within one per cent of the arm's reach, and the nearest curve's distance at half the equation's terms, as a share of the reach. ellipse: degree 2, 4 terms, only exact, 11% at half, 34 bars exact; parabola: degree 2, 6 terms, only exact, 35% at half, 52 bars exact; cubic: degree 3, 8 terms, 4 terms, 0.75% at half, 101 bars exact; folium: degree 3, 11 terms, only exact, 29% at half, 160 bars exact; lemniscate: degree 4, 5 terms, only exact, 34% at half, 50 bars exact; quintic: degree 5, 18 terms, 6 terms, 0.32% at half, 413 bars exact. The last column gives the bars of the machine compiled from the exact equation and, where there is one, from the nearest curve within one per cent.
Fig. 2 The six curves: degree, the terms the exact equation costs, the fewest terms whose nearest curve comes within one per cent of the reach, and the nearest curve’s distance at half the equation’s terms.

At half the equation’s terms, the cubic and the quintic are within 0.75% and 0.32% of the reach, and the others between 11% and 35%. The split does not follow the degree, since both kinds occur at degree three, nor the number of terms, since the cheap quintic has the most.

What the four terms are

A quintic of eighteen terms, and the nearest curve that costs a fewThe quintic x^5 + 0.4x^2y − y = 0, whose equation expands into 18 cosines of the arm's two angles, inside the arm's reach (dashed). Drawn over it, the curve of the same degree with at most 4 terms that comes nearest to it inside the reach, found by trying every set of terms of that size: it keeps 0,1|1,0, 1,-2|2,-1 and is at most 2.77e-2 from the quintic and the quintic at most that from it — 1.4% of the reach. The slider steps through the budgets at which the nearest curve improves.the quintic, 18 termsnearest with 4 terms4 terms: 1.4% of the reachexact at 18
Fig. 3 The quintic inside the arm’s reach, and over it the nearest curve with four terms. The slider steps through the budgets at which the nearest curve improves.

The figure below shows the quintic x5+0.4x2y−y=0x^5 + 0.4x^2y - y = 0 and its nearest four-term curve, which is indistinguishable from it at the figure’s scale over the whole reach. The four terms are two classes, (0,1∣1,0)(0,1|1,0) and (1,−2∣2,−1)(1,-2|2,-1), and what they are is visible in the census that found the cheapest curves.

The first class is what xx and yy themselves expand into: the tip’s coordinates are ℓ(cos⁡α+cos⁡β)\ell(\cos\alpha + \cos\beta) and ℓ(sin⁡α+sin⁡β)\ell(\sin\alpha + \sin\beta), frequencies (1,0)(1,0) and (0,1)(0,1). The second is what the square of the radius, r2=x2+y2r^2 = x^2 + y^2, adds when it multiplies them: xr2x r^2 and yr2y r^2 expand into the first class and the second and nothing else. So the family of curves the four terms can draw is

ax+by+r2(cx+dy)=0,a x + b y + r^2 (c x + d y) = 0,

a line through the pivot bent by the square of its distance from it. The quintic’s nearest four-term curve is exactly that, with a=−0.094a = -0.094, b=−0.539b = -0.539, c=0.564c = 0.564 and d=−0.182d = -0.182. Its nearest six-term curve adds one more class, (2,−3∣3,−2)(2,-3|3,-2), which is what xr4x r^4 and yr4y r^4 contribute: the next power of the bending. The cubic’s nearest four-term curve has the same two classes.

That family is the odd-degree end of what the cheapest curves at each degree found. There, a line through the pivot times Chebyshev’s polynomials in the elbow angle was the cheapest curve of odd degree. Here the same pieces, added rather than multiplied, make the family that is cheap to be near. In polar coordinates every member passes through the pivot once, with a single tangent, and away from the pivot its radius at each direction is set by a ratio of two cosines.

Why four curves cannot be reached

The family explains the split. The cubic x3−0.2x−y=0x^3 - 0.2x - y = 0 and the quintic both pass through the pivot once, with one tangent, and bend away from that tangent as the radius grows. That is the shape the family has, and a few powers of the radius are enough to follow them across the reach.

The four expensive curves do not pass through the pivot that way. The ellipse and the parabola do not pass through it at all. The lemniscate and the folium pass through it twice, crossing themselves, so their lowest-order part at the pivot is a pair of lines rather than one. No member of a family with a single tangent at the pivot can follow a crossing there, and adding powers of the radius cannot supply a second tangent. Those curves’ nearest cheap neighbours come from other classes, and the price curve shows none of them gets close.

The ellipse shows what the nearest cheap neighbour is when the family is out of reach. Its equation, x2+2.2y2=1.6x^2 + 2.2y^2 = 1.6, costs four terms in three classes: (1,−1)(1,-1) and (1,1)(1,1) alone, and the pair (0,2∣2,0)(0,2|2,0). Given one, two or three terms, the nearest curve keeps the same single class, (1,−1)(1,-1), a cosine of the elbow angle alone, and adding (1,1)(1,1) does not move it. A cosine of the elbow angle alone is a circle about the pivot, the cheapest curve there is. So the nearest cheap curve to the ellipse is a circle between its two semi-axes, 1.265 and 0.853, and it misses by about half their difference: 0.21 by that arithmetic, 0.228 measured, 11% of the reach. The ellipse’s eccentricity is the whole of what its fourth term buys, and no rearrangement of fewer terms buys any of it back.

The folium's loop is paid for by every one of its terms. The folium x^3 + y^3 − 1.5xy = 0, which crosses itself at the pivot and closes a loop inside the reach, and whose equation costs 11 terms. Over it, the nearest curve of degree three with at most 10 of them, found by trying every set: it keeps 0,1|1,0, 0,2|2,0, 1,-1, 1,1, 1,-2|2,-1 and is 1.04e-1 from the folium at worst, 5.2% of the reach. With one term fewer than the equation it still misses by more than twice the cubic's four-term curve.
Fig. 4 The folium x3+y3−1.5xy=0x^3 + y^3 - 1.5xy = 0, which crosses itself at the pivot and closes a loop inside the reach, and the nearest curve of degree three with ten of its eleven terms.

The folium with ten of its eleven terms shows what that costs. The nearest ten-term curve follows the two arms of the folium away from the pivot and the loop’s far side, and misses at the crossing, where it passes on one side instead of through, and around the loop, by 5.2% of the reach. The one term it lacks is the one that makes the crossing a crossing. With a budget one short of exact, a machine drawing the folium draws a different curve. The lemniscate is the same case at a smaller size. It costs five terms and crosses itself at the pivot too. Its nearest four-term curve, 7.9% of the reach away, trades the lemniscate’s own class (2,−2)(2,-2) for (1,−3∣3,−1)(1,-3|3,-1), a class the lemniscate does not contain. It still draws a figure of eight through the pivot, but a flattened one: its two branches cross at a shallower angle, and its lobes are too thin at the middle and too long at the ends. Four terms can make a crossing; they cannot make this one.

The terms that matter are not the largest

The natural shortcut, without a search, is to keep the target’s largest terms and refit. On the quintic that shortcut fails at the first step that matters.

The terms the nearest curves keep are not the quintic's largest. The quintic's eighteen terms in their 9 mirror classes — a pair of frequencies with its mirror under swapping the arm's links, or a pair on the circle diagonal alone — by amplitude, largest first: 0,1|1,0 6.289, 1,2|2,1 3.139, 1,-2|2,-1 3.127, 0,3|3,0 1.566, 2,-3|3,-2 0.625, 2,3|3,2 0.625, 1,-4|4,-1 0.313, 1,4|4,1 0.313, 0,5|5,0 0.063. Below, for the nearest curves with 4, 6, 8 and 10 terms, the classes each keeps. The nearest four-term curve keeps the largest class and the third, 1,-2|2,-1, not the second, 1,2|2,1, whose amplitude is larger by 0.4%; the nearest curves with more terms reach down into classes of amplitude 0.3 while passing over classes of 1.6.
Fig. 5 The quintic’s eighteen terms in nine mirror classes, by amplitude, largest first; below, the classes kept by the nearest curves with 4, 6, 8 and 10 terms.

The quintic’s classes, by amplitude, are (0,1∣1,0)(0,1|1,0) at 6.289, (1,2∣2,1)(1,2|2,1) at 3.139, (1,−2∣2,−1)(1,-2|2,-1) at 3.127, (0,3∣3,0)(0,3|3,0) at 1.566, and then five smaller ones down to 0.063. The second and third differ by 0.4%. The nearest four-term curve keeps the first and third. It passes over the second, because the second is not part of the line-bent-by-its-radius family and the third is. The nearest curves with more terms keep reaching into classes of amplitude 0.6 and 0.3 while passing over the second-largest class, and the nearest ten-term curve leaves it out entirely.

Keeping the quintic's largest terms can cost fifteen times the nearest curve. The quintic's price two ways. Searched: the nearest curve over every set of terms of each size up to ten. Truncated: the quintic's own classes of terms kept in order of amplitude and refitted. At 4 terms, searched 1.4%; At 6 terms, searched 0.68%; At 8 terms, searched 0.32%; At 10 terms, searched 0.021%. Truncated: 2 terms, 21%; 4 terms, 21%; 6 terms, 1.4%; 8 terms, 97%; 10 terms, 0.024%; 12 terms, 0.024%; 14 terms, 0.000055%; 16 terms, 0.000055%; 18 terms, 3.3e-14%. At four terms the truncation keeps the second-largest class and misses by 15 times the searched curve; at eight it grows a stray branch across the reach.
Fig. 6 The quintic’s price two ways: the nearest curve over every set of terms of each size up to ten, and the quintic’s own classes kept in order of amplitude and refitted.

Kept in order of amplitude and refitted, the quintic is 21% of the reach away at four terms, fifteen times the searched curve’s 1.4%, because the fourth term chosen is from the second-largest class. At eight terms the truncation grows a stray branch across the reach and is further away than at six. Only from ten terms on does keeping the largest reach what the search reaches, and from there it goes on down, to 5×10−75 \times 10^{-7} at fourteen, where the search was not run.

An amplitude says how large a term is in the expansion. It does not say how much of the curve’s shape inside the reach depends on it, because much of a large term can be cancelled by the others within the reach and much of a small one cannot. The search measures that; the amplitudes do not.

What the budget buys in bars

A term is a gadget, and a gadget is bars: angle multipliers built from nested parallelograms, adders, translators that carry a vector to where it is needed. So the price curve can be read in the unit a machine is actually built in. The machine compiled from the quintic’s exact equation has 413 bars. The machine compiled from its nearest four-term curve has 37, and it is 1.4% of the reach away. Six terms take 78 bars and come within 0.68%, eight take 110 and ten take 157, 0.021% away. The cubic’s exact machine has 101 bars, and its four-term neighbour has the same 37 as the quintic’s, since it is built from the same two classes.

The bars do not fall in proportion to the terms. A high-frequency term needs an angle multiplied several times over, each multiplication a stack of parallelograms, and the quintic’s highest classes are the most expensive gadgets in its machine. Those are exactly the classes the nearest curves do without. So the four-term machine is less than a tenth of the exact one’s size, where four terms of eighteen would suggest a fifth, and it draws the quintic across the whole reach to within 1.4% of the reach.

The price is on the equation found that a curve’s cost depends on which of its equations is compiled: multiply an equation by a factor that vanishes nowhere in the reach and the curve is the same while the machine is not. The price curve here is a second way the same curve can come cheaper, by giving up exactness rather than changing the equation, and for the quintic it is the larger of the two by far. A demand that is an equation set out to compile any curve exactly. That generality has a price the approximate versions escape, provided the curve is of the right kind.

Prescribing a curve rather than points put the compiled machine’s four hundred bars beside a four-bar that passes through nine prescribed points and no more. The four-term machine sits between them. It follows the curve everywhere in the reach, which the four-bar does not, and it does so with a tenth of the exact machine’s bars. The trade that the linkage that is only nearly right made by choosing precision points, the compiler makes by choosing terms, and the search here is its version of choosing them well.

What a designer can take from it

The price of a close machine is not the price of the exact one scaled down, and a designer cannot tell the two kinds of curve apart by counting terms or by degree. What tells them apart is geometric and checkable before any search: whether the curve passes through the arm’s pivot once, with one tangent. If it does, a machine can be built from a line through the pivot bent by one or two powers of the radius, at four or six terms, whatever the curve’s own count. If it does not, the whole equation is the price.

That also says where to put the pivot. The pivot is the designer’s choice, since the arm can be mounted anywhere. A target curve that passes nowhere near the pivot, like the ellipse here, might be cheap to be near if the arm is mounted on it. Two circles for the price of one found that concentric circles about the pivot are nearly free. A circle elsewhere costs more, and the same circle with the pivot at its centre costs one term.

What the search does not settle

One degree. Every nearest curve here has the target’s own degree. A curve of higher degree can be cheaper, as the Chebyshev circles are, and a search that allowed it might find cheaper neighbours for the four expensive curves. The search at higher degree is larger and was not run.

The reach, not the arc. The distance is measured over the whole of the curve inside the arm’s reach. A machine that draws only one arc of a curve could be close on that arc and far elsewhere, and priced on the arc alone the expensive curves might be cheaper.

Budgets up to ten. For the quintic the search stops at ten terms; beyond that only the truncation was measured, and it is an upper bound on the price.

The machine’s own error. The compiled machine draws its curve exactly in principle. Every bar has a length error in practice, and a machine of four terms has fewer bars to be wrong. Whether that makes the close machine closer, in practice, than the exact one is not measured here.

Still open: moving the pivot

The split between cheap and expensive curves is about where the curve passes relative to the pivot, and the pivot can be placed. Mount the arm at a different point and the same target has a different equation, a different expansion and a different price curve.

The distinct argument there would be the best place to mount the arm for a given target, priced by the nearest curve at a fixed budget. For the ellipse, the pivot at its centre makes its axes into terms the census has already priced; on the curve itself, the ellipse passes through the pivot once, with one tangent, and the four-term family might follow it. The measurement would take the ellipse, the parabola and the folium, sweep the pivot over a grid of positions around each, and map the nearest four-term curve’s distance. Its minimum would say whether an expensive curve is expensive in itself, or only because of where the arm was put.

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 curveApproximationCompiled machineCost modelFrequency pairImplicit equationSparsityTrigonometric polynomialTwo-link arm