0
$\begingroup$

I am attempting to create a small computer simulation with planetary orbits.

Calculating the position a planet has on its orbit at a certain time works fine. However, I now want to draw their orbits as well.

The problem is, that to draw an Ellipse in most computer programs, I need to specify the center (x,y) coordinates as well as a width and a height. However, the only information I have available is the following;

  • The (x,y) coordinates of one of the focal points $f$, as this is the position the planet revolves around.
  • The size of the semi-mayor axis $a$ of the ellipse.
  • The eccentricity $\epsilon$ of the ellipse.

(Also, it is presumed that the semi-mayor axis is parallel to the x-axis.)

How can this information be used to calculate the (x,y) position of the center of the ellipse?

$\endgroup$
  • $\begingroup$ en.wikipedia.org/wiki/Ellipse $\endgroup$ – amd Jan 8 '16 at 22:22
  • $\begingroup$ @amd thank you for pointing to Wikipedia, but I would not have asked this question if I had been able to find an answer there. $\endgroup$ – Qqwy Jan 8 '16 at 22:31
  • 1
    $\begingroup$ $\epsilon=c/a$, where $c$ is the distance from one focus to the center. $\endgroup$ – Aretino Jan 8 '16 at 22:36
  • 1
    $\begingroup$ More specifically, en.wikipedia.org/wiki/Ellipse#Eccentricity, which gives you the same relationship between eccentricity, focal distance and semi-major axis as in Aretino’s comment. $\endgroup$ – amd Jan 8 '16 at 22:47
  • 1
    $\begingroup$ Be careful with your terminology. A focal point is different to a focus. For a curve (without inflexions) every point on the curve has a corresponding focal point (the centre of of osculating circle), and so the focal points trace out a new curve called the evolute. Only ellipses, hyperbolae and parabolae have foci, and they are isolated points. $\endgroup$ – Fly by Night Jan 9 '16 at 1:14
1
$\begingroup$

Turning existing comments into an answer: Wikipedia will tell you that

$$\epsilon=\dots=f/a$$ (where again $a$ and $b$ are one-half of the ellipse's major and minor axes respectively, and $f$ is the focal distance)

So you know $\epsilon$ and $a$, you can compute $f$ and that's the distance between focus and center. If the term “focal distance” isn't clear enough (it could be the distance between the foci, after all), the images on Wikipedia make it clear that this is the distance you need, between center and focus. If you also know the direction, you can just move that distance in the given direction. However, your specification doesn't tell us whether you should move in the positive or the negative $x$ direction. But perhaps you know which.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.