Get all points in an ellipse knowing the center, one point, the vertical axis and the horizontal axis

3.7k Views Asked by At

How to get all the points in an ellipse when I know a point of it and it's center?

I have the following situation:

enter image description here

I know the position of the red dot relative to the center, I have the vertical distance and the horizontal distance values. What I need is to calculate all the other possible points in the ellipse, as to know what other points the dot can be if it orbits the ellipse.

I have a coordinate system to make that

How is it possible to be done?

@EDIT

I'm also able to know the major axis and the minor axis

1

There are 1 best solutions below

0
On BEST ANSWER

Let $a,b$ be the major and minor axes of the ellipse.

Let $x_0,y_0$ be the coordinates of the center on the ellipse.

Let $x_1,y_1$ be the coordinates of the one point on the ellipse.

First, we write the equation of the ellipse, those major axis is parallel to the $x$ axis of the coordinate system (which is at this point completely arbitrary).

$$\frac{(x-x_0)^2}{a^2}+\frac{(y-y_0)^2}{b^2}=1$$

Now we need the ellipse to go through the point $x_1,y_1$. This requires first that the distance between this point and the center is somewhere between $a$ and $b$:

$$b \leq \sqrt{(x_1-x_0)^2+(y_1-y_0)^2} \leq a$$

If it's indeed true, we need to find the four corresponding points on the ellipse on the same distance from the center.

$$d=\sqrt{(x_1-x_0)^2+(y_1-y_0)^2}$$

One of them is a green point on the picture below:

enter image description here

We need to find the green point. Let's call it $x_2,y_2$. Then we have two equations in two variables:

$$\frac{(x_2-x_0)^2}{a^2}+\frac{(y_2-y_0)^2}{b^2}=1$$

$$(x_2-x_0)^2+(y_2-y_0)^2=(x_1-x_0)^2+(y_1-y_0)^2$$

After you solve this simple system of equations and find $x_2,y_2$, there is one last step left: you need to rotate your ellipse.

First, find the angle between lines going from the center of the ellipse to $x_1,y_1$ and to $x_2,y_2$. You can do it by using vector dot product:

$$\cos \theta=\frac{(x_1-x_0)(x_2-x_0)+(y_1-y_0)(y_2-y_0)}{\sqrt{(x_1-x_0)^2+(y_1-y_0)^2}\sqrt{(x_2-x_0)^2+(y_2-y_0)^2}}$$

The rotated coordinates can be then found from the following system of equations:

$$x=X \cos \theta-Y \sin \theta \\ y=X \sin \theta+ Y \cos \theta$$

Note, that I inverted the problem - as if the ellipse is already rotated counter-clockwise, and we want to rotate it back. Meaning, we just substitute these formulas in the original equation:

$$\frac{(X \cos \theta-Y \sin \theta-x_0)^2}{a^2}+\frac{(X \sin \theta+ Y \cos \theta-y_0)^2}{b^2}=1$$

And here is the equation for your ellipse. You still need to find $x_2,y_2$ and $\cos \theta$ - I leave it to you.

See http://en.wikipedia.org/wiki/Rotation_matrix for more about rotation.

Note, that there is four possible green points you can choose, so there is four different equations you might need to check, not two.