# How does one change the gradient of a sine wave?

I can make a sine wave travel parallel to the $x$ and $y$ axis of a cartesian plane, however I have yet to find any formula that allows one to change the gradient of the sine wave. How does one do that? I have tried the following, and it is not what I am after:

$f(x)=\sin(x)+x$

• How about $x=\sin y$? – Arthur Feb 28 '17 at 7:40
• nay, that makes the wave paralell to the y axis, thanks though – Mike Kennard Feb 28 '17 at 7:44
• So what do you mean by "parallel to the x and y axis"? Do you mean at $45^\circ$ outwards? – Arthur Feb 28 '17 at 7:47
• oooh, soz, quite right, i meant to say i can only make the wave parallel to the x or y axis, how does one change the gradient of the wave, as in make it not paralell to the x or y axis – Mike Kennard Feb 28 '17 at 7:54
• Oh, right, it actually says so in the question. I apparently can't read today. – Arthur Feb 28 '17 at 7:58

In linear algebra you learn to rotate the plane. If you want to rotate some geometrical structure defined by its coordinates (such as the graph of a function, defined by the points $(x, f(x))$, or a figure defined by an equation, or just a list of points) counterclockwise by an angle of $\theta$, you replace $x$ by $x\cos\theta + y\sin\theta$ and you replace $y$ with $y\cos\theta - x\sin\theta$. This means that the formula for a rotated sine wave (given originally by $y = \sin(x)$) is $$y\cos\theta - x\sin\theta = \sin\left(x\cos\theta + y\sin\theta\right)$$ If the axis of the rotated sine wave is closer to the $x$-axis than to the $y$-axis (for instance is $\theta$ is between $\pm 45^\circ$), then this can theoretically be rearranged to a function $y = f(x)$, but I have no idea how it would be done. Similarily, if the new axis is more aligned with the $y$-axis, the above expression can be rearranged to a function $x = f(y)$, but I still do not know how.
• While this is a good answer to a different question, this is not what the asker wants. He wants a formula for a rotated graph of a sine wave. Not compressed / stretched like you get when changing the argument to $ax$, not skewed like you get by adding $x$ outside the sine. – Arthur Feb 28 '17 at 8:01