Trochor – Animated Virtual Harmonograph
June 23
The pattern traced out by Trochor is what you’d get if you took a pencil moving in ellipses, and used it to draw on a sheet of paper that’s also moving in ellipses. It’s a bit like a spirograph, but not constrained in quite the same ways. It’s more like a harmonograph; more on that later.
Have fun, play around with the settings, especially ‘ratio’; that’s probably the best way of figuring out what’s going on. ‘Eccentricity’, by the way, is a measure of how flattened an ellipse is – an ellipse with 0 eccentricity is a circle, one with 1 is a line.
The Long Version
I first stumbled on trochoids by playing around with plotting trigonometric functions.
I wondered what would happen if you took the basic parametric equations for plotting a circle –
x = radius * cos (θ)
y = radius * sin (θ)
– and added them to the equation for another circle, turning more than one circle in the time it takes to draw the first one, so we get something like the trails left by a point on a wheel rolling around another wheel (an epitrochoid or hypotrochoid), with these equations:
x = radius1 * cos (θ)
+ radius2 * cos (ratio * θ)
y = radius1 * sin (θ)
+ radius2 * sin (ratio * θ)
This makes some pleasing shapes, so I thought I would try animating it.
The most obvious thing to do is to change the relative phase of the first and second circles, but this just turns the whole thing round.
What’s more interesting is to animate the phase of the x component (the cosine) in the opposite direction to the y component (sine):
x = radius1 * cos (θ) + radius2 * cos (ratio * θ + f)
y = radius1 * sin (θ) + radius2 * sin (ratio * θ – f)
This makes the circle shrink to a line, then grow into a circle flowing the opposite way, and then go through the same cycle again.
Combined with the first circle, this makes the sort of animations you can see above.
Pleased with the results of this, in 2001 I made an applet to let people play with it, and that’s where things stood till September 2004.
Then I read a gorgeously produced wee book called Harmonograph: A Visual Guide to the Mathematics of Music.
Harmonograph provides an impressively clear and thorough introduction to the basics of music theory, and ways of visualising music.
It does this in 50-odd pages, replete with beautiful illustrations of harmony made by harmonographs, kaleidophones, Chladni plates and the like.
A harmonograph is an instrument invented in the mid-nineteenth century, using two or more pendulums to produce beautiful pictures. The pictures are especially beautiful when the ratios of the frequencies of the pendulums are close to whole numbers, just as chords are especially beautiful when the ratios of the frequencies notes making them up are close to whole numbers.
The pictures I was making with Trochor were almost the same pictures produced by a rotary harmonograph, except that the pendulums of a harmonograph steadily wind down as they draw, and Trochor was arbitrarily restricted to whole-number ratios between the two drivers.
A kaleidophone, like a harmonograph, creates images of harmonics, but these are made only fleetingly, in light. It consists of a metal rod fixed in a stand, with a reflective bead on top, which is struck and then stroked with a bow.
A beam of light reflected from the top of it casts patterns onto a screen, rather like those of a rotary harmonograph, but more complex.
The biggest difference, judging by the illustrations I have seen, is that it is not restricted to circular motion:
Free to vibrate in any direction, it produces patterns composed of interacting linear waves and ellipses.
I have incorporated the idea of using ellipses, together with the damped spiralling motion and non-integer ratios of the harmonograph, into Trochor.
With 0 eccentricity, we are back to the rotary harmonograph; with 1, we have the linear harmonograph, producing Lissajous-type figures.
The equations of this version are as follow:
x = (1-damping)n * (axis1a * cos
(θ) + axis2a * cos (ratio * θ + f))
y =(1-damping)n * (axis1b * sin (θ) + axis1b * sin (ratio * θ – f))
The code for this applet is available for anyone curious – but bear in mind I wrote most of this around eight years ago, and the rest three years or so after that, and it’s not necessarily the best code! I should probably re-do this in Processing really.
Wow, amazing
Pretty neato.
beautiful and perplexing animations these,i often imagine visual music interfaces and find your work very interesting along with some other stuff i have found online,might be sending you a message someday,asking for some code.must learn processing first though…
i just read the harmonograph book and it has just occurred to me that it is possible to reverse engineer the concept and make sounds from your applets,generate from you drawings sounds?
Absolutely love these things of beauty. No idea about the maths. I would imagine you have heard of krazydad.com, really nice flash toys. So you know, safari 3.2.1 doesn’t handle this site very well, but Firefox 3.5.2 does fine. I found the site by googling harmonograph. Again it is a good thing that you have made this site
i cannot understand it. i am not good in mathemtics. please give me a point how to become good in trigonometry!!!!!
Hi kerth, you might like to have a read of my trigonometry page at http://oolong.co.uk/trig.htm …that’s about the best I can offer you!
Here is another really cool online harmonograph. Move and zoom with the mouse scrool wheel
http://swantesson.com/harmonograph.html