TITLE: Is there a way to rotate the graph of a function?
QUESTION [39 upvotes]: Assuming I have the graph of a function $f(x)$ is there function $f_1(f(x))$ that will give me a rotated version of the graph of that function?
For example if I plot $\sin(x)$ I will get a sine wave which straddles the $x$-axis, can I apply a function to $\sin(x)$ to yield a wave that straddles the line that would result from $y = 2x$?

REPLY [6 votes]: For common functions, it ms very easy.  $f(x)$ rotated $\phi$ is can be calculated by $(x+f(x)\cdot i)(\cos(\phi)+\sin(\phi)\cdot i)$ as coordinates instead of complex numbers.  Let's, however, replace $x$ with $t$, just to reduce confusion.
$(t+f(t)\cdot i)(\cos(\phi)+\sin(\phi)\cdot i) =
t\cos(\phi)-f(t)\sin(\phi)+t\sin(\phi)\cdot i+f(t)\cdot \cos(\phi)\cdot i$
In parametric form, that's:
$X=t\cos(\phi)-f(t)\sin(\phi)$
$Y=t\sin(\phi)+f(t)\cos(\phi)$
To convert that to a function, we find $t$ as a function of $x$ and plug that into $Y$ as a function of $t$.
This is possible with some equations, such as $f(t)=t^2$ or $f(t)=\dfrac 1t$.  However, with the sine function, it's not very easy.  In fact, there is no definite function for the rotation of a sine function.  However, you can represent it as an infinite polynomial.
The parametric of this graph would be
$X=\dfrac{t-2\sin(t)}{\sqrt5}$
$Y=\dfrac{2t+\sin(t)}{\sqrt5}$
To approximate a polynomial $y$-as-a-function-of-$x$ formula, we find the coefficients for each part of this formula.
The $x^0$ coefficient is the $y$-intercept divided by $0!$ ($y$ when $x$ is zero)/$0!$
The $x^1$ coefficient is the $y$-intercept of the derivative divided by $1!$
 $((y$ when $x$ is $0.00001)-(y$ when $x$ is $0))/0.00001/1!$
The $x^2$ coefficient is the $y$-intercept of the second derivative divided by $2!$
$((y$ when $x$ is $0.00002)-2*(y$ when $x$ is $0.00001)+(y$ when $x$ is $0))/0.00001/0.00001/2!$
The $x^3$ coefficient is the $y$-intercept of the third derivative divided by $3!$
$((y$ when $x$ is $0.00003)-3*(y$ when $x$ is $0.00002)+3*(y$ when $x$ is $0.00001)-(y$ when $x$ is $0))/0.00001/0.0001/0.0001/3!$
In case you haven't noticed, I'm using Pascal's triangle in this calculation.
I hope this helps!