I'm trying to impose a sine wave onto two different curves, sort of similar to this old question about an Archimedes spiral. Unfortunately I can't figure out how to incorporate the new sine wave into the more complex equations I'm dealing with.
The trefoil equation:
$x = sin(t)-2*sin(2*t)$
$y = cos(t)+2*(cos(2*t)$
$z = 3*sin(3*t)$
And the second curve:
$x = (15+sin(t/2))*cos(t)$
$y = (15+sin(t/2))*sin(t)$
$z = (15*cos(t/2)$
With t ranging from -2 pi to 2 pi. In both cases the new sine wave will have a length of 4 pi, though I would like to be able to change the position of nodes/antinodes within the curves.
I see you found an answer you are happy with, but I wanted to give my result anyway, which basically works for any parametric curve in $\mathbb{R}^3$.
All you really need to do is calculate the binormal (or normal if you choose) vector and multiply it by $b\sin(ct)$, for chosen small $b$ and large $c$, then add that to the original. If $r(t)$ is the vector valued function with your $x,y,$ and $z$, and $B$ is your binormal, then $$r(t) + b\sin(ct)B(t)$$
Here is what it looks like in Maple for $b=0.075$ and $c=200$. I was going to try to reparametrize by arclength, but it looks pretty decent as is, and Maple was not enjoying trying to compute the arclength integral.
This might be a useful website: https://janakiev.com/blog/framing-parametric-curves/.
Update
As requested, here is the Maple code I used. I am sure it is rather close to any other software you might be doing this in. I was looking at both the normal and the binormal, which is why used the TNB frame. That just computes the tangent (T), normal (N), and binormal (B), all together, so tnb[3] is just grabbing the binormal and not using the other ones.