Is there a way to rotate the graph of a function?

Once you rotate, it need not remain a function (i.e. one $x$ value can have multiple $y$ values corresponding to it).

But you can use the following transformation

$$x' = x\cos \theta - y \sin \theta$$ $$y' = x \sin \theta + y \cos \theta$$

to rotate by an angle of $\theta$. Point $(x,y)$ gets rotated to point $(x',y')$. Note: this is a rotation about the origin.

In your case of $y = 2x$, you need to rotate by $\arctan(2)$.

See this for more info: Rotation Matrix.


Yes you can, but it might not be a function. Say y = f(x) is the curve you want to rotate. Then the equation of the curve of f(x) rotated by n radians is: ycos(n) - xsin(n) = f(ysin(n) + xcos(n)) Try it out here: https://www.desmos.com/calculator


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!