0

I was trying to make a sine wave function that is tilted, just like this:

I'm new to this community and I can't add images yet so here's the link

I found that there are plenty of similar functions, that use tangent, or are a series of "recursive" functions, and many many others. Most of them are easy to plot, except $y=sin(x+y)$, which has y in both left and right side. I didn't find any explanation how to plot this function or others similar to this. My trigonometry skills didn't help either. I wasn't able to come to anything close to form like $y=$ $(some$ $expression$ $witn$ $x$ $only)$. I need this formula for my C++ program.

But strangely enough Desmos is able to plot $y=sin(x+y)$ function or others where $y$ is present on both sides and used in functions like $sin()$. I'm okay with "recursive" one, which is $y=sin(x+ksin(x+ksin(...)))$, where $k$ is skew factor (because I don't want very much of skew). But I'm just curios about those kind of functions and their plots.

So, how does Desmos plot those functions? How do I plot one, say on paper or using programming skills?

P. S. I don't need a similar function, I need to plot exactly $y=sin(x+y)$.

EDIT: It would be better to have $y=$ $(some$ $expression$ $witn$ $x$ $only)$ form of function, if it's somehow possible. I don't think it's possible but who knows...

  • 1
    Part of the graph is plotting $x=\sin^{-1}(y)-y+2\pi n,n\in\Bbb N$ – Тyma Gaidash May 28 '22 at 21:03
  • The other part of the graph is plotting $x = -\sin^{-1}(y) - y + \pi + 2\pi n, n \in \mathbb{Z}$ –  May 28 '22 at 21:12
  • @carefree-xplorer Big thanks! This pretty much answers my question, but is there a way to get $y=...$ form of the function? – postcoital.solitaire May 28 '22 at 21:35
  • @mollis_cactus I doubt it, but I could be wrong. –  May 28 '22 at 21:37
  • What I suggest is a for loop. Given $x$ let u=0;v=sin(x) then loop doing u=sin(x+v); v=sin(x+u) a few times and finally use the average of u and v. – Somos May 29 '22 at 02:13
  • @Somos, Harvard wants to know your location xD I tried using this method and I was shocked from how precise it actually worked. I tried this in python though, because it's the easiest way to show to others. You may try it yourself, just go here and paste this text, and click execute. It should show a plot, where blue line is an ordinary sine, yellow one is "true" skewed sine, from Carefree's comment, and red dots is your function's plot. This is done with 30 iterations, and notice how precise it is! – postcoital.solitaire May 30 '22 at 23:32
  • @Somos, could you explain how your algorithm actually works? It's so simple and precise yet non-intuitive at all. I can't understand it but it works remarkably well. – postcoital.solitaire May 30 '22 at 23:58
  • @mollis_cactus It was not that hard. A simple u=sin(x+u) iteration converges to the exact value in the limit, but I noticed that it alternately is greater and less than the limit, so I used the average of two consecutive values which is much closer to the limit. – Somos May 31 '22 at 00:35

0 Answers0