# Calculating a Point that lies on an Ellipse given an Angle

I need to find a point (A on this diagram) given the center point of the ellipse as well as an angle. I've been melting my brain all day (as well as searching through questions here) testing out different equations. What's the best way to do this?

I intend to grab point A at 225 degrees as well as another point at approximately 250 degrees using the same math. These need to be fetched regardless of elliptic width and height.

-

If the ellipse is centered at the origin, the equation of the ellipse is $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$. The equation of the line is $y=\tan \theta x$ So you have $\frac{x^2}{a^2}+\frac{(\tan \theta x)^2}{b^2}=1$ or $x=\pm \frac{ab}{\sqrt{b^2+a^2(\tan \theta)^2}}$ where the sign is + if $-\pi/2 \lt \theta \lt \pi/2$

-
Well, this is embarrassing. The code I was working with already fetches the exact same value this does. I was sure my math was wrong. It looks like I'll have to figure out how to handle this data in Flash given its wonky co-ordinate system. Regardless, thanks for the quick answer. –  null Feb 14 '11 at 23:53

If the ellipse is centered at $(0,0)$, $2a$ wide in the $x$-direction, $2b$ tall in the $y$-direction, and the angle you want is $\theta$ from the positive $x$-axis, the coordinates of the point of intersection are $$\left(\frac{a b}{\sqrt{b^2+a^2\tan^2(\theta)}},\frac{a b \tan(\theta)}{\sqrt{b^2 + a^2\tan^2(\theta)}}\right) \text{ if }0\le\theta< 90°\text{ or }270°<\theta\le360°$$ or $$\left(-\frac{a b}{\sqrt{b^2+a^2\tan^2(\theta)}},-\frac{a b \tan(\theta)}{\sqrt{b^2 + a^2\tan^2(\theta)}}\right) \text{ if }90°<\theta< 270°.$$

-
Doesn't $\tan$ become negative for $\theta \gt 90^{\circ}$ so the signs are flipped over $90^{\circ}$ to $270^{\circ}$ –  Ross Millikan Feb 14 '11 at 23:36
@Ross: I think I've got the signs and ranges right now (perhaps you were looking at my initial post with incorrect ranges). For example, between 90° and 180°, using the second formula and tangent is negative, the $x$-coordinate is negative and the $y$ coordinate is positive (opposite of the negative tangent), which is correct for angles between 90° and 180°. –  Isaac Feb 14 '11 at 23:43
Looks good to me –  Ross Millikan Feb 15 '11 at 1:20

You can also use parametric equations:

$$x=a\cos(\theta)$$ $$y=b\sin(\theta)$$

Where $a$ is the radius on the horizontal axis, and $b$ is the radius on the vertical axis.

-
In this parametrization, $\theta$ is not the angle of the post, for example for $\theta=225$ of the diagram the corresponding point on the ellipse is not given by your formulas. –  coffeemath May 19 '13 at 17:28
@coffeemath Why wouldn't $x = a\cos(225°)$ and $y=b\sin(225°)$ work? –  Ataraxia May 19 '13 at 17:33
@Zettasurro -- those equations will give you a point on the ellipse. But the polar angle of this point will not be 225 degrees. –  bubba May 19 '13 at 23:28
@Zettasurro The angle from the point you mention in your comment would have tangent equal to $(b/a)\tan(225)$, and so would not be 225 degrees unless $a=b$ (the ellipse is a circle). –  coffeemath May 20 '13 at 1:05
@coffeemath Why is that a problem? Since it's not a circle, doesn't it make sense for the slope of the tangent not to equal $\tan(225)$? –  Ataraxia May 20 '13 at 1:11