I'm trying to create a simulation of a three pendulum rotary harmonograph, the one you can see in action in this video or in these instructions.
As you can see in the video, there are 2 pendulum with 1 degree of freedom each (one axis of movement) plus 1 pendulum with 2 degrees of freedom (the one in the middle, holding the sheet of paper).
I'm currently able to simulate the movement of a pen attached to just 2 pendulum (with 1 degree of freedom each) using this formula
(t = time, f = frequency, p = phase, d = damping, a = amplitude)
The result of this formula will give me the position of the pen on the x axis. I can then use it a second time with different values to obtain the position of the pen on the y axis. Very straightforward: result is here.
So, how can I add the third pendulum (the one with 2 degrees of freedom)? This formula can compute the position of a rod connected to a pendulum with two degrees of freedom:

However, I don't think this is what I need. The formula only gives me as a result one number: the movement of the pendulum makes the sheet of paper move on two axis (and I would even say 3, judging by the fact that the sheet of paper doesn't stay parallel to the plane).
So how in the world do I project the movement of a pendulum moving in 3d space over a 2d plane? Is this what I really need to do? If yes how?
Finally, even assumed that I'm able to do so, how should I insert these results into the pen x and y position? I presume is a matter of just making an addition: am I wrong?
(p.s. please forgive any possible triviality in my question. As you probably have guessed, I've never been taught physics nor computer science)
EDIT:
here's my pain. I can only simulate figures on the left. The one on the right requires a third pendulum, and this third pendulum is not oscillating in just one direction but two (or three?!).. (Image from "Quadrivium: The Four Classical Liberal Arts of Number, Geometry, Music, & Cosmology").
