# Rotate the parabola $y=x^2$ clockwise $45^\circ$.

I used the rotation matrix to do this and I ended up with the equation: $$x^2+y^2+2xy+\sqrt{2}x-\sqrt{2}y=0$$

I tried to plot this but none of the graphing softwares that I use would allow it.

Is the above the correct equation for a parabola with vertex (0,0) and axis of symmetry $y=x$ ?

$$\left( \begin{array}{cc} \cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\\ \end{array} \right)\left( \begin{array}{cc} x\\ y\\ \end{array} \right)=\left( \begin{array}{cc} X\\ Y\\ \end{array} \right)$$

For a clockwise rotation of $\frac{\pi}{4}$, $\sin{-\frac{\pi}{4}}=\frac{-1}{\sqrt{2}}$ and $\cos{-\frac{\pi}{4}}=\frac{1}{\sqrt{2}}$

$$\left( \begin{array}{cc} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}\\ \end{array} \right)\left( \begin{array}{cc} x\\ y\\ \end{array} \right)=\left( \begin{array}{cc} X\\ Y\\ \end{array} \right)$$

$$X=\frac{x}{\sqrt{2}}+\frac{y}{\sqrt{2}}$$ $$Y=\frac{-x}{\sqrt{2}}+\frac{y}{\sqrt{2}}$$ $$y=x^2$$ $$\left(\frac{-x}{\sqrt{2}}+\frac{y}{\sqrt{2}}\right)=\left(\frac{x}{\sqrt{2}}+\frac{y}{\sqrt{2}}\right)^2$$ $$\frac{-x}{\sqrt{2}}+\frac{y}{\sqrt{2}}=\frac{x^2}{2}+\frac{2xy}{2}+\frac{y^2}{2}$$ $$-\sqrt{2}x+\sqrt{2}y=x^2+2xy+y^2$$ $$x^2+2xy+y^2+\sqrt{2}x-\sqrt{2}y=0$$

Have I made a mistake somewhere?

• Jul 18, 2017 at 19:25
• It looks like you ended up rotating anticlockwise? $0=x^2+y^2-2xy-x\sqrt{2}-y\sqrt{2}$ is probably the right answer. desmos.com/calculator/4fkthwcvvd Jul 18, 2017 at 19:28
• desmos.com/calculator/mupzvz0i1i ... your equation is fine ... might have told us you started with $x=y^2$ ? Jul 18, 2017 at 19:31
• if $(1,-1)$ and $(1,1)$ were solutions prior to rotation, and you rotate 90 degrees clockwise, then $(\sqrt 2,0), (0,\sqrt 2)$ should be solutions post rotation. Jul 18, 2017 at 19:31
• In general, if points are transformed according to some function $\phi$, you need to transform the equation by the inverse of $\phi$. E.g., to move the vertex of the parabola to $(h,k)$, you subtract these coordinates from the variables $x$ and $y$ in the equation. Similarly, to rotate the graph clockwise, you need to apply a counterclockwise rotation to the variables in the equation.
– amd
Jul 18, 2017 at 21:04

$$Ax^2+Bxy+Cy^2+Dx+Ey+F = 0$$

or equivalently, we can write it as

$$\begin{pmatrix} x & y & 1 \end{pmatrix}\begin{pmatrix} A & B/2 & D/2\\ B/2 & C & E/2\\ D/2 & E/2 & F \end{pmatrix}\begin{pmatrix} x\\ y\\ 1 \end{pmatrix}=0$$

(we will denote the above 3x3 matrix with $M$)

So, let's say you are given a conic section $v^\tau M v = 0$ and let's say we want to rotate it by angle $\varphi$. We can represent appropriate rotation matrix with

$$Q_\varphi=\begin{pmatrix} \cos \varphi& -\sin\varphi & 0\\ \sin\varphi & \cos\varphi & 0\\ 0 & 0 & 1\end{pmatrix}$$

Now, $Q_\varphi$ represents anticlockwise rotation, so we might be tempted to write something like $$(Q_\varphi v)^\tau M (Q_\varphi v) = 0$$ to get conic section rotated by angle $\varphi$ anticlockwise. But, this will actually produce clockwise rotation. Think about it - if $v$ should be a point on the rotated conic, then $Q_\varphi v$ is a point on conic before rotation, thus, the last equation actually means that the new conic rotated anticlockwise will produce the old conic.

So, let us now do your exercise. You have conic $y = x^2$, so matrix $M$ is given by $$M =\begin{pmatrix} 1 & 0 & 0\\ 0 & 0 & -1/2\\ 0 & -1/2 & 0\end{pmatrix}$$ and you want to rotate your conic clockwise by $\pi/4$, so choose $$Q_{\pi/4}=\begin{pmatrix} \cos \frac\pi4& -\sin\frac\pi4 & 0\\ \sin\frac\pi4 & \cos\frac\pi4 & 0\\ 0 & 0 & 1\end{pmatrix}.$$

Finally, we get equation $$\begin{pmatrix} x & y & 1 \end{pmatrix}\begin{pmatrix} \cos \frac\pi4& -\sin\frac\pi4 & 0\\ \sin\frac\pi4 & \cos\frac\pi4 & 0\\ 0 & 0 & 1\end{pmatrix}^\tau\begin{pmatrix} 1 & 0 & 0\\ 0 & 0 & -1/2\\ 0 & -1/2 & 0\end{pmatrix}\begin{pmatrix} \cos \frac\pi4& -\sin\frac\pi4& 0\\ \sin\frac\pi4 & \cos\frac\pi4 & 0\\ 0 & 0 & 1\end{pmatrix}\begin{pmatrix} x\\ y\\ 1 \end{pmatrix}=0$$

or simplified $$x^2-2xy+y^2-x\sqrt 2-y\sqrt 2 = 0.$$

• Ennar can you have a look at my workings above? There must be a mistake somewhere that I can't find. Jul 18, 2017 at 20:54
• @Derek, take a look at the paragraph where I say that $Q_\varphi$ seemingly produces anticlockwise rotation, but actually produces clockwise. I'm a bit tired and going for bed, so I'm not really reading into details that you wrote, but I think that is what you did. Does it make sense for you? Jul 18, 2017 at 20:56
• Well I know that I rotated it anticlockwise but I don't know at which point I went wrong. Jul 18, 2017 at 21:02
• @Derek, well I just told you, right. You represent points of the original conic with $(x,y)$, rotate it by $-\pi/4$ to get points of the new conic $(X,Y)$ and then you write $Y = X^2$ which is obviously wrong. Precisely the problem that I described in my answer. Jul 18, 2017 at 21:04
• @Derek, what you should do is rotate $(X,Y)$ by $\pi/4$ to get $(x,y)$ (this is equivalent to rotating $(x,y)$ by $-\pi/4$ to get $(X,Y)$ like you did) and write $y = x^2$ instead. I've explained this in my answer, if you need clarification on it, let me know. Jul 18, 2017 at 21:08

Before rotating (and plotting), you need to parametrize your parabola:

$$\begin{cases} x(t) = t\\ y(t) = t^2 \end{cases},$$

where $t \in \mathbb{R}.$ You are rotating each point of the parabola, and hence:

$$\begin{bmatrix}X(t)\\Y(t)\end{bmatrix} = \frac{\sqrt{2}}{2}\begin{bmatrix}1 & -1\\1 & 1\end{bmatrix}\cdot\begin{bmatrix}x(t)\\y(t)\end{bmatrix} = \frac{\sqrt{2}}{2}\begin{bmatrix}x(t)-y(t)\\x(t)+y(t)\end{bmatrix}.$$

At the end you get that:

$$\begin{bmatrix}X(t)\\Y(t)\end{bmatrix} = \frac{\sqrt{2}}{2}\begin{bmatrix}t(1-t)\\t(1+t)\end{bmatrix}.$$

This can be plotted in Matlab using the following code:

t=linspace(-3,3,100);
X=(sqrt(2)/2)*(t.*(1-t));
Y=(sqrt(2)/2)*(t.*(1+t));
plot(X,Y)


This is what you get:

Your result is corect. This is the plot in geogebra.org

• OP wanted clockwise rotation, not anticlockwise. Jul 18, 2017 at 20:51

Rotating the parabola $y=x^2$ by $\theta$ clockwise gives $v=u^2$, where $$\left(u\atop v\right)=\left(\cos\theta\quad-\sin\theta\atop\sin\theta\quad\;\;\;\cos\theta\right)\left(x\atop y\right)$$ i.e. $$x\sin \theta+y\cos\theta=(x\cos\theta-y\sin\theta)^2$$ Putting $\theta=\frac\pi 4$ gives $$\frac 1{\sqrt2}(x+y)=\left(\frac 1{\sqrt2}(x-y)\right)^2\\ \sqrt2(x+y)=(x-y)^2$$ which when expanded is $$x^2+y^2-2xy-\sqrt2 x-\sqrt2 y=0$$

• But why do you use $\frac{\pi}{4}$ to go clockwise ? That is what confuses me. I mean if you go clockwise 45 degrees from the positive x-axis you will be at -45 degrees. So surely you should go $-\frac{\pi}{4}$ Jul 19, 2017 at 17:00
• The matrix is just defined that way. The matrix you're looking for has the negative sign on the bottom left corner. You can derive this using the substitution x=cos(t) y = sin(t) making it an AC rotation Jul 19, 2017 at 20:33
• @Derek - Think of it as rotating the axes $\frac\pi 4$ anti-clockwise. Jul 20, 2017 at 2:05

if you want to prove that the axis of symmetry rotates with the function then simply show that $$M(\theta)R(\theta)(x,y)=R(\theta)(x',y')$$ where $$R$$ and $$M$$ are rotation and reflection matrices respectively given that $$\theta=0$$ is the line of symmetry.