18
$\begingroup$

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?

enter image description here

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

5 Answers 5

15

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=x\tan \theta $ So you have $\frac{x^2}{a^2}+\frac{(x\tan \theta )^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$

  • 0
    BM Does not work for all angle. @CharlesL. But the sign condition is different, isn't it?2016-10-28
6

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°.

  • 0
    @Tony I think 90° and 270° are excluded because $\tan\theta$ would be undefined.2018-02-10
6

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.

  • 0
    @Atraxia this may help: http://math.stackexchange.com/questions/493104/evaluating-int-ab-frac12-r2-to-find-the-area-of-an-ellipse/687384#6873842014-02-23
3

I've been working on this one for a while now because I was trying to test a coordinate for overlap with an ellipse, and I came up with something much easier to find the point on an ellipse given an angle from the center. If you use a general first degree equation for the line and substitute into the equation for an ellipse then you can solve for x and y (the points where the line intercepts the ellipse).

To find the general first degree equation of a line, you can use this formula : $(y_1 - y_2)*x + (x_2 - x_1)*y + (x_1*y_2 - x_2*y_1) = 0$

Since the ellipse is centered on the origin and the line passes through it as well, you can simplify the equation for the line by substituting $x_1 = 0$ and $y_1 = 0$ and you come up with : $-y_2*x + x_2*y = 0$

Solve for x and y and you get $x = \frac{x_2*y}{y_2} , y = \frac{y_2*x}{x_2}$

Next use the equation for an ellipse $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$ and substitute in x and y and solve for $y^2$ and $x^2$ respectively. You come up with these two equations : $y^2 = \frac{a^2*b^2*y_2^2}{(b^2*x_2^2 + a^2*y_2^2)} , x^2 = \frac{a^2*b^2*x_2^2}{b^2*x_2^2 + a^2*y_2^2}$ If you know the point on the line you can substitute in $x_2$ and $y_2$, but since all we have is an angle, we'll have to re-derive our line equation. It's not hard though. To find the x and y coordinates of a point using a radius (which we won't need) and an angle, you just use a little trigonometry. The x value of the triangle is $r*\cos{\theta}$ and the y value is $r*\sin{\theta}$. Substitute these in for $x_2$ and $y_2$ above and you get $-r\sin{\theta}*x + r\cos{\theta}*y = 0$. Notice you can divide by the radius now to remove it from the equation, leaving us with $-\sin{\theta}*x + \cos{\theta}*y = 0$. Re-substitute into the earlier equation and you get $y = \sin{\theta}$ and $x = \cos{\theta}$. Substitute these into the equations for $y^2$ and $x^2$ and you come up with the following equations. $y = \pm\frac{ab\sin{\theta}}{\sqrt{(b\cos{\theta})^2 + (a\sin{\theta})^2}} , x = \pm\frac{ab\cos{\theta}}{\sqrt{(b\cos{\theta})^2 + (a\sin{\theta})^2}}$

You now know another formula to find the coordinates of a point on an ellipse given only an angle from the center, or to determine whether a point is inside an ellipse or not by comparing radii. ;)

0

The equation of an ellipse in its origin centered form is:

$(\frac{cos \theta} {a})^2 + (\frac{sin \theta} {b})^2=(\frac{1}{ r})^2 $.

Hope you take it from there.