# Trying to figure out how to rotate an ellipse...

• Feb 8th 2011, 09:48 PM
thyrgle
Trying to figure out how to rotate an ellipse...
Hi,

So, I have been trying to figure out how to rotate an ellipse in the form of:

$\displaystyle x^2/a^2 + y^2/b^2 = 1$

My guess is that making a translate vector of T<x^2, y^2> will do the trick. My goal is simply to make the ellipse not vertical or horizontal. My reasoning is because ^2 will have moved the numbers farther away from zero more than the numbers closer to zero resulting in a rotation. Is my reasoning correct? And, how could I find the equation of an ellipse if I wanted to rotate it x degrees?
• Feb 8th 2011, 09:57 PM
FernandoRevilla
Use the transformation:

$\displaystyle \begin{bmatrix}{x}\\{y}\end{bmatrix}=\begin{bmatri x}{\cos \alpha}&{-\sin \alpha}\\{\sin \alpha}&{\;\;\;\cos \alpha}\end{bmatrix}\begin{bmatrix}{x'}\\{y'}\end{ bmatrix}$

(rotation around the origin and angle $\displaystyle \alpha$)

Fernando Revilla
• Feb 8th 2011, 10:00 PM
thyrgle
@Fernando Revilla: Thanks for the response. But, I am confused how does it work? (I am taking Algebra 2 this year). Or would it be to complicated for someone with my math knowledge to understand right now?
• Feb 8th 2011, 10:43 PM
skoker
it might help if you post a specific conic that you have. centered at (0,0).
• Feb 8th 2011, 11:30 PM
FernandoRevilla
Quote:

Originally Posted by thyrgle
@Fernando Revilla: Thanks for the response. But, I am confused how does it work? (I am taking Algebra 2 this year). Or would it be to complicated for someone with my math knowledge to understand right now?

I don't know if you have covered the equation of a rotation. For example, if $\displaystyle \aplha=\pi/6$ then:

$\displaystyle \begin{bmatrix}{x}\\{y}\end{bmatrix}=\begin{bmatri x}{\sqrt{3}/2}&{-1/2}\\{1/2}&{\;\;\;\sqrt{3}/2}\end{bmatrix}\begin{bmatrix}{x'}\\{y'}\end{bmatr ix}\Leftrightarrow \begin{Bmatrix} x=(\sqrt{3}/2)x'-(1/2)y'\\y=(1/2)x'+(\sqrt{3}/2)y' \end{matrix}$

Substitute $\displaystyle x,y$ for example in

$\displaystyle E\equiv \dfrac{x^2}{9}+\dfrac{y^2}{4}=1$

and you'll obtain the equation of $\displaystyle E$ by means of a rotation.

Fernando Revilla
• Feb 9th 2011, 02:55 AM
HallsofIvy
What Fernando Revilla gave is a matrix multiplication. Another way to say essentially the same thing is to use the "coordinate transformation" $\displaystyle x= x'cos(\theta)- y' sin(\theta)$, $\displaystyle y= x'sin(\theta)+ y' cos(\theta)$ where I have just written out the result of the matrix multiplication. Here, $\displaystyle \theta$ is the angle of rotation (about the origin), x and y are the original coordinates, and x' and y' are the rotated coordinates.

For example, if the original ellipse were $\displaystyle x^2+ 2y^2= 1$, that transformation would give, for any angle, $\displaystyle \theta$,
$\displaystyle (x'cos(\theta)- y'sin(\theta))^2+ 2(x' sin(\theta)+ y'cos(\theta))^2= cos^2(\theta)x'^2- 2sin(\theta)cos(\theta)x'y'+ sin^2(\theta)y'^2$$\displaystyle + 2sin^2(\theta)x'^2+ 4sin(\theta)cos(\theta)x'y'+ cos^2(\theta)y'^2 \displaystyle = (cos^2(\theta)+ 2sin^2(\theta))x'^2+ 2sin(\theta)cos(\theta)x'y'+ (sin^2(\theta)+ 2cos^2(\theta))y'^2= 1. Notice a few thing about that- all terms are still quadratic. Linear terms signal a translation of the center of the figure but rotating keeps the center at (0, 0). There is, however, an " x'y' " term that is not in the "standard" form for a conic section. That signals a rotation. If, say, the angle of rotation were \displaystyle \pi/4, then the equation would be \displaystyle \frac{3}{2}x'^2+ x'y'+ \frac{3}{2}y'^2= 1. However, \displaystyle sin(\pi/2)= 1 and \displaystyle cos(\pi/2)= 0 so that a rotation by a right angle would give math] \displaystyle 2x'^2+ y'^2= 1 just switching "major axis" and "minor axis". Typically, what one wants to do is the "other way around"- given a quadratic in two variables, say \displaystyle xy= 1, write it in "standard form". Writing \displaystyle x= x'cos(\theta)- y' sin(\theta), \displaystyle y= x'sin(\theta)+ y' cos(\theta), \displaystyle xy= (x'cos(\theta)- y'sin(\theta))(x'sin(\theta)+ y'cos(\theta))$$\displaystyle = sin(\theta)cos(\theta)x'^2+ (cos^2(\theta)- sin^2(\theta))x'y'+ sin(\theta)cos(\theta)y'^2= 1$.

Now, to remove the x'y' turn, which never appears in the "standard form", I have to choose $\displaystyle \theta$ to make $\displaystyle cos^2(\theta)- sin^2(\theta)= 0$. That's easy. Either replace $\displaystyle sin^2(\theta)$ with $\displaystyle 1- cos^2(\theta)$ to get $\displaystyle 2cos^2(\theta)- 1= 0$ so that $\displaystyle cos^2(\theta)= \frac{1}{2}$ or recognize that $\displaystyle cos^2(\theta)- sin^2(\theta)= cos(2\theta)$ so that we must have $\displaystyle cos(2\theta)= 0$.

Either gives $\displaystyle \theta= \pi/4$ so that $\displaystyle sin(\theta)= cos(\theta)= \frac{1}{\sqrt{2}}$ and the equation becomes $\displaystyle \frac{1}{2}x'^2- \frac{1}{2}y'^2= 1$. That shows that the graph of xy= 1 (or y= 1/x) is a hyperbola with the lines y= x and y= -x as axes, the x and y axes as asymptotes.