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

161.2k Views Asked by At

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$?

3

There are 3 best solutions below

4
On BEST ANSWER

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.

1
On

You can do the rotation as Moron says, or you can write $y=2x+\sin(x)$. This will remain a function, but doesn't have the same shape as a sine wave. It depends upon what you want.

0
On

In general, the answer is no since the rotated version of the graph might not be the graph of a function. For instance it could happen that your rotated version of the graph contains two different points with the same $x$-value -- this cannot happen for the graph of a function.

A way out could be to parametrise your graph. So instead of a map $x\mapsto y(x)$ you look at the map $t\mapsto (t,y(t))$. After rotating the trajectory of this thing (not the graph!) it will still be the trajectory of a map $$t\mapsto (x(t),y(t)).$$