To be more precise:
Given a line L
, called a directrix, a point F
not on L
, called a focus, and a positive number e
. Let d(X,L)
denote the distance from a point X
to L
, and let |X|
denote the norm of X
. The set C
of points X
satisfying
|X - F| = e d(X,L)
is called a conic section with eccentricity e
. It is called an ellipse if e < 1
, a parabola if e = 1
, and a hyperbola if e > 1
.
Now what you want is the Cartesian equation of the conic in standard form. If e < 1
or e > 1
and the directrix is parallel to the y
-axis, the conic C
is the set of points X = (x,y)
satisfying
x^2 / a^2 + y^2 / [a^2 (1 - e^2)] = 1
where a = e d / (1 - e^2)
and d = d(F,L)
is the distance from the focus to the directrix.
If e < 1
(so that a > 0
), let b = a sqrt(1 - e^2)
. We then obtain the equation of an ellipse in standard form
x^2 / a^2 + y^2 / b^2 = 1
where a,b
are called the semi-major and semi-minor axis respectively. In this form,
- the ellipse center is at the origin
(0,0)
, - the directrix crosses the
x
-axis at point(d,0)
, - the two foci are at points
(-c,0)
,(c,0)
wherec = a e
andc^2 = a^2 - b^2
, - the two vertices on the
x
-axis are at points(-a,0)
,(a,0)
, and - the two vertices on the
y
-axis are at points(0,-b)
,(0,b)
.
So your a
is the distance from a x
-vertex to the center and not to a focus. However, note that c
is the distance from a y
-vertex to a focus. This may be a source of confusion.
You can see that a
, b
are your missing xDistance
, yDistance
. It appears you are given a
and e
, so you only need to compute b
as above.
Of course, you can always check ellipse @wikipedia. This figure will help visualize my previous descriptions, but note that my c
is denoted as f
there.