This Demonstration shows a two-linkage inverse-kinematic mechanism. The lengths of the rods shown in the diagram are and , and their angles of rotation are and , with ranges to and to , respectively. The coordinates of a point on the toroidal surface are

,

.

Solving for and :

,

,

where and .

With appropriate choices of the constants, the formulas for and can be used to trace a sine wave, an ellipse, or a triangle.