TITLE: Reversing the process of taking the "sine of an arbitrary shape"
QUESTION [11 upvotes]: I'm sure we've all seen images such as the following, from wikipedia: link. They give us some nice intuition on what the sine and cosine functions are. Some people may also have seen images such as this one, or even this one, where instead of a circle, we take the 'sine of an arbitrary shape,' hence the title of this question. I'll say that the shape generates a periodic function in this way.
I now have a couple questions:

Given a periodic function, is there always a shape that generates that function as in the second image (with the period adjusted as necessary, of course)?
Are such shapes necessarily unique for a given periodic function (provided they exist)?
In particular, what are the shapes (if any) that generate triangle, square, and sawtooth waves?

Also, if this is something that has been studied in detail, please enlighten me as to the terminology that people might use in this context.

REPLY [4 votes]: My original answer was mostly wrong, so I am replacing it here with something that is (I think) actually correct.
Suppose you have a periodic functions, $f(t)$, with  period $T$.  We want to define a path in $\mathbb{R}^2$ such that the "sine" of the path (in the sense of the examples in the OP) is $f(t)$.  What do we mean by this?  Specifically, we want to arrange things so that as a "radius" vector from $(0,0)$ to the path sweeps around in a circle with uniform speed, the $y$-coordinate of the point on the path to which it points will be equal to $f(t)$.
Let's get more precise, here.  We want to parametrize a path $(x(t),y(t)), t \in [0,T]$, so that $y(t)=f(t)$ and so that the angle $\theta=\arctan(y/x)$ varies smoothly from $0$ to $2\pi$ as $t$ runs from $0$ to $T$.  In other words, we want $\theta = 2\pi t/T$.  We now have two different conditions on $\theta$.  Combining them, we have
$$ \arctan(y/x) = 2 \pi t / T $$
$$ y/x = \tan (2 \pi t / T)$$
$$ x = y \cot (2 \pi t / T)$$
Therefore, the path we want is given by the parametrization
$$(x(t),y(t)) = (f(t) \cot (2 \pi t / T), f(t))$$
Notice that in the special case where $f(t)$ is the "normal" sine function, this formula reduces to $(x(t),y(t)) = (\cos(t) , \sin(t) ) $, i.e. the usual parametrization of a unit circle.
It is worth nothing, though, that if the periodic functions you are trying to match have any discontinuities in them (as is the case of the square and sawtooth waves) then the "path" $(x(t),y(t))$ will also likely have a discontinuity in it.