"Ptolemaic (Fourier) Synthesis"

Most closed curves can be arbitrarily well approximated by epicycles, i.e., a sum of rotating vectors whose lengths and rpm are fixed in advance. You get to choose only the length and initial phase of each rotor, yet this usually suffices to draw not only any outline, but also with almost any speed profile.

Unnecessarily strong restrictions (e.g., finitely many discontinuties or finite total variation) are usually placed on the closed curve to simplify the convergence proof. Here is an apparently successful synthesis of a cogwheel with infinitely many (discontinuous) teeth. It is simply the complex plane image under 1/(z+2) of the square wave x+(-1) floor(x)i.


load("c:\\rwg\\climax\\fouchk.lsp")$

We have computed exactly the harmonics -19 through 19. Those for -1, 0, and 1 are

(c8)
fou[-1]

(d8) ((log(((tanh(((%pi)/2)))/(tanh(((3 * %pi)/2))))))/(4 * %pi)) - ((%pi * coth(%pi))/(2 * sinh(%pi))) + (1/(2 * sinh(%pi)))

(c9)
fou[0]

(d9) ((log(((tanh(((3 * %pi)/2)))/(tanh(((%pi)/2))))))/(8 * %pi)) - (1/(2 * sinh(%pi))) - ((3 * %i)/8)

(c10)
fou[1]

(d10) ((log(((tanh(((%pi)/2)))/(tanh(((3 * %pi)/2))))))/(16 * %pi)) + (1/(4 * sinh(%pi))) - ((5 * %i)/16)

The approximate series for harmonics -9 thtough 9 is

(c3)
rectformlist(sum(sfloat(dfloat(fou[k]))*%e^(%i*t*k),k,-9,9))

(d3) [2.44141e-4 * sin(9 * t) - 0.01477 * cos(9 * t) - 4.88281e-4 * sin(8 * t) - 0.02006
* cos(8 * t) + 9.76563e-4 * sin(7 * t) + 0.05833 * cos(7 * t) - 0.00195 * sin(6 * t) + 0.0042
* cos(6 * t) + 0.00391 * sin(5 * t) - 0.0713 * cos(5 * t) - 0.00781 * sin(4 * t) + 0.04462
* cos(4 * t) + 0.01562 * sin(3 * t) + 0.10228 * cos(3 * t) - 0.03125 * sin(2 * t) - 0.009
* cos(2 * t) + 0.3125 * sin(t) - 0.08017 * cos(t) - 0.03986,
0.01659 * sin(9 * t) - 2.44141e-4 * cos(9 * t) + 0.01101 * sin(8 * t) + 4.88281e-4
* cos(8 * t) + 0.0401 * sin(7 * t) - 9.76563e-4 * cos(7 * t) + 0.05347 * sin(6 * t) + 0.00195
* cos(6 * t) + 0.03132 * sin(5 * t) - 0.00391 * cos(5 * t) + 0.03099 * sin(4 * t) + 0.00781
* cos(4 * t) + 0.10692 * sin(3 * t) - 0.01562 * cos(3 * t) + 0.16889 * sin(2 * t) + 0.03125
* cos(2 * t) + 0.12003 * sin(t) - 0.3125 * cos(t) - 0.375]

(c4)
rectformlist(sum(sfloat(dfloat(fou[k]))*%e^(%i*t*k),k,-19,19))$

The parametric description of the cogwheel is

(c5)
rectformlist(subst(11*t,t,1/(t+%i*(2+(-1)^floor(t)))))

(d5) [((11 * t)/((( - 1)^(floor(11 * t)) + 2)^2 + 121 * t^2)), - ((( - 1)^(floor(11 * t)) + 2)/((( - 1)^(floor(11 * t)) + 2)^2 + 121 * t^2))]

Plotting the cogwheel (green), the 9th order approximation (red), and the 19th (blue):

(c7)
block([equalscale:true,plotnum:999],paramplot(''(map(first,[d3,d4,d5])),''(map(second,[d3,d4,d5])),t,-%pi,%pi))$

picture

The exact coefficients are strenuous to compute, being polynomials in both pi and csch pi, and thus having quadratically may terms:

(c11)
length(fou[-19])

(d11) 111

(c12)
(map('abs,args(fou[-19])),[apply(max,%%),apply(min,%%)])

(d12) [((143274604 * (%pi)^11 * cosh(%pi))/(14175 * sinh^4(%pi))), ((65536 * (%pi)^19 * cosh(%pi))/(5 * sinh^20(%pi)))]

(c13)
sfloat(%)

(d13) [1937820.5, 2.38138e-7]

I.e., the 111 terms in the coefficient for frequency -19 range over 13 orders of magnitude, totaling

(c14)
sfloat(dfloat(fou[-19]))

(d14) - 0.0012

(c15)

But bounded variation is also too strict, since we can approximate a(n infinite arclength, though continuous) Snowflake, via


load("c:\\rwg\\climax\\snof.lsp")$

(c16)
subst(inf,'(snuff(2*k,n)),snof)

(d16) sum(((product((1 - (( - 1)^j * tan(((%pi * (2 * k + (1/3)))/(2^j)))/(sqrt(3)))),j,1,inf)) * (%e)^(%i * (6 * k + 1) * t)/((2 * k + (1/3))^2)),k, - n,n)

I.e., each coefficient is a (rapidly convergent) infinite product. For convergence to screen resolution, the function SNUFF(k,n) is "infinite" enuff:

(c17)
fundef(snuff)

(d17) snuff(k, n) := floor(((log(2000 * %pi * abs(k + (1/3)) * n))/(log(2))))

Taking succesively 3, 5, 13, 49, and 241 Fourier terms:

(c21)
makelist(rectformlist(sfloat(apply_nouns(dfloat(apply_nouns(''snof))))),n,[1,2,6,24,120])$

(c22)
first(%)

(d22) [1.04812 * cos(7.0 * t) + 0.94035 * cos(5.0 * t) + 10.6333
* cos(1.0 * t), 1.04812 * sin(7.0 * t) - 0.94035 * sin(5.0 * t) + 10.6333
* sin(1.0 * t)]

(c24)
block([plotnum:3333,equalscale:true],paramplot(''d21,t,-%pi,%pi))$

picture

(c25)

picture

The disjunction "finitely many discontinuities" or "bounded total variation" is still too strong, since we could replace the smooth arcs of the cogwheel by snowflake arcs, invoking an almost certain lemma that we can switch at least once between two Fourier approximable curves.