# How to do Trammel Of Archimedes Animation?

How does one make a Trammel Of Archimedes?

Trammel of Archimedes

A trammel of Archimedes is a mechanism that generates the shape of an ellipse. It consists of two shuttles which are confined ("trammelled") to perpendicular channels or rails and a rod which is attached to the shuttles by pivots at fixed positions along the rod.

As the shuttles move back and forth, each along its channel, the end of the rod moves in an elliptical path. The semi-axes a and b of the ellipse have lengths equal to the distances from the end of the rod to each of the two pivots.

How does one do a looping animation like this?

Animate both "shuttles" moving on different axis by keyframing their X and and Y positions in sync. Start at say $$X=-1$$ at frame $$0$$ then $$X=1$$ at frame $$30$$, and back at $$X=-1$$ at frame $$60$$, repeat for Y axis for the other shuttle.

In the Curve Editor move their animation curve keyframes so that they are offset by "half a cycle". That is if one apexes every $$x$$ frames, the other one should apex at frames $$x+1.5x$$.

Add a Cycles modifier to both curves so they repeat indefinitely.

Create a "bar" object, move it so that it's origin it is exactly coinciding with one the shuttles, then parent the bar to that shuttle with Ctrl + P.

Add a Track to Constraint pointing to the other shuttle, adjusting the axis settings as necessary.

As mentioned by Robin Betts, for a mathematically perfect animation the f-curve should be a perfect sine wave. Use a Built-in Function f-curve modifier instead of manually keyframing the shuttels and using the Cycles modifier.

Set it to a Sine function, so the shuttles have mathematically correct motion relative to each other. With the previously described technique you will notice a wobble between the second bar hole and the corresponding shuttle caused by the manually keyframed animation.

• Simple and effective. Great to see the big D answering. – batFINGER Jan 29 '20 at 3:41
• @batFINGER Thanks. Sadly not as common as I'd like these days, but I do miss it – Duarte Farrajota Ramos Jan 29 '20 at 13:13
• Great presentation ..Do you know a way to generate a perfectly sinusoidal f-curve, apart from drivers? Because that's what you need.. (X of the X slider = cos(t), Y of the Y slider = sin(t) or vice-versa) to keep the distance between the blocks perfectly constant, and scribe an ellipse.. – Robin Betts Jan 29 '20 at 23:56
• @RobinBetts Indeed, you are right. If you look closely you will notice that my animation is not perfect. The second blue bar hole slightly wobbles relative to its shuttle because animation curve are not perfect mathematical sine functions. Now that you mention it you can use the curve modifier Bul-tin Function to generate a perfect sine. See updated answer for details. – Duarte Farrajota Ramos Jan 30 '20 at 1:16
• .... and I learned a new modifier into the bargain. – Robin Betts Jan 30 '20 at 9:02

Add two default circle curves at origin. Give one a follow path constraint targeting the other

Make it a fixed offset type, where 0 is one end, 1 the other, or for the case of a closed curve one single orbit.

For simplicity this is given a driver such that it does one revolution in 25 frames. Divide frame by 25, then modulus (or remainder when divided by) one.

(frame / 25) % 1


Making it rotate about z axis exactly one full 2 * pirevolution on each orbit. Exactly like the moon around the earth. Or simply 2 * pi times offset above. To avoid circular refs have calculated again rather than using modifier offset as a variable input into driver.

Drivers editor

Object Properties panel

2 * pi * ( (frame / 25) % 1)


Note this is very similar to methods used here

Calculate sphere's rotation for rolling

I am trying to make an animation of a double planet, can't seem to get it right.

Lastly parent an arm to the orbiting curve, aligned along a diameter.

Note very poor effort at dynamic paint in image above, but shows the ellipse.

A circle of twice the scale of originals has been added to simulate question gif.