3

I'm creating a computer program where I need to calculate the parametrized circumference of an ellipse, like this:

x = r1 * cos(t), y = r2 * sin(t)

Now, say I want this parametrized ellipse to be tilted at an arbitrary angle. How do I go about this? Any obvious simplifications for i.e 30, 45 or 60 degrees?

Pedery
  • 149

3 Answers3

3

If you want to rotate $\theta$ radians, you should use $$t\mapsto \left( \begin{array}{c} a \cos (t) \cos (\theta )-b \sin (t) \sin (\theta ) \\ a \cos (t) \sin (\theta )+b \sin (t) \cos (\theta ) \end{array} \right) $$

1

If you rotate $(x=r_1\cos t,y=r_2\sin t)$ by $\theta$ about $(0,0)$, the resulting curve is given by $(x'=r_1\cos t\cos\theta-r_2\sin t\sin\theta, y'=r_1\cos t\sin\theta+r_2\sin t\cos\theta)$.

(Using the fact that complex multiplication by $e^{i\theta}$ rotates by $\theta$ about $0$, the point $(x,y)=x+yi$ is mapped to $(x+iy)(\cos\theta+i\sin\theta)=$ $x\cos\theta-y\sin\theta+i(x\sin\theta+y\cos\theta)=$ $(x\cos\theta-y\sin\theta,x\sin\theta+y\cos\theta)$.)

Isaac
  • 36,557
0

Update:

Given

$x = r_1 \cos(t)$, $y = r_2 \sin(t)$

using the equation of ellipse in polar form we have : (could someone confirm this please?)

$ r(\theta) = \frac {r_1r_2}{\sqrt {{r_1^2 \sin^2 (\theta)}+{r_2^2 \cos^2 (\theta)}}} $

to rotate by angle $\phi$ :

$ r(\theta) = \frac {r_1r_2}{\sqrt {{r_1^2 \sin^2 (\theta-\phi)}+{r_2^2 \cos^2 (\theta-\phi)}}} $

The original incorrect answer is below:

$x = r_1 \cos(t + \phi)$, $y = r_2 \sin(t + \phi) \text {, where }\phi$ is your angle of tilt in radians

This was as pointed out was my mistake on thinking polar while working with parametric. I have tried converting this to polar form but adding angle of $\phi$ and reverting back to parametric form so far has not been possible.

Has anyone seen solution of this problem by converting to polar coordinates and performing an angle addition and converting back to parametric form?

jimjim
  • 9,675
  • 1
    I'm pretty sure that just changes the parameterization (which points correspond with which values of the parameter), not the orientation of the resulting curve. – Isaac Jan 14 '11 at 07:22
  • Yep, Isaac is correct. it would produce the same looking ellipse since t is in the interval [0, 360], regardless of whether a constant is added. Your answer would simply start and end the ellipse at a different place along the curve. – Pedery Jan 14 '11 at 07:25
  • @Arjang: the problem is that they aren't occurring "at" $\frac{\pi}{2}$ or $0$ in the sense of polar location; they are occurring "at" those values in the sense of, for instance, time. The points are still in the same places. – Isaac Jan 14 '11 at 07:30
  • @Isaac and Pedery, yes you are correct, trying to figure out why I thought of this method. – jimjim Jan 14 '11 at 07:41
  • @Arjang: It's easy to write a polar equation for an ellipse with a focus at the pole, but not so much for one centered at the pole. – Isaac Jan 16 '11 at 08:27
  • @Isaac : I tried figuring out the polar equation of ellipse centered at the pole, see if it is correct. – jimjim Jan 23 '11 at 20:56
  • 1
    @Arjang: It looks like it works, but I think you want $\theta-\phi$ instead of $\theta+\phi$. – Isaac Jan 24 '11 at 01:55
  • @Isaac : Thanks, fixed!, Also turned it into community wiki ( is that good ?) – jimjim Jan 24 '11 at 02:16