Beruflich Dokumente
Kultur Dokumente
February 2, 2018
Abstract
In this article, we briey review some important calculations related to the equa-
tion of the ellipse. Firstly we show how to obtain the equation in cartesian coordi-
nates using only the geometrical denition of the ellipse. Then we use it to obtain
the polar equation with center at the origin and then we show how to transform it
into its foci-centered form. We also show how to obtain the equation of the ellipse
given two points of the ellipse, its corresponding slopes and provided one of the
semi axes is parallel to the X axis. Although all the results presented here are very
well known, the explicit calculations are intended to serve as didactic reference for
students and professors.
1 Introduction
An ellipse is a conic section as the circle and parabola are. These are called conic sections
because they can be obtained by cutting a cone from dierent planes as shown in gure
(1). Precisely dened,an ellipse is the gometric place in which the sum of the distances
with respect to two xed points called foci, is constant as shown in gure (2).
Starting with the given denition, we will now nd the well known equation of the el-
lipse in cartesian coordinates with center in the origin. First we need to transform the
1
Figure 2: Let p be a point of the ellipse, f1 and f2 be the foci. Another point q will be
a point of the ellipse if and only if the sum of the distance from q to f1 plus the
distance from q to f2 equals to rf1 + rf2
denition into a couple of equations. Refering to gure (2), let a point p having cartesian
coordinates (x, y), be a point of the ellipse. Let f1 and f2 be the foci and k be the sum
of the distance from p to f1 plus the distance from p to f2 . Let u and s be points which
form a vertical and a horizontal line with O respectivaley.
(1)
p p
k= (f − x)2 + y 2 + (f + x)2 + y 2
Now, call a to the distance between s and O and call b to the distancepbetween u and
O. Using the Pitagorean theorem, the distance from u to f1 (or f2 ) is f 2 + b2 . This
means that u will be a point of the ellipse if and only if:
(2)
p
k = 2 f 2 + b2
Also, s will be a point of the ellipse if and only if:
k = a − f + a + f = 2a (3)
Combining (2) and (3) we obtain:
f 2 = a2 − b2 (4)
Before proceeding any further, it is convenient to note that the following equations
hold:
p p
(f − x)2 + y 2 − (f + x)2 + y 2 = −4f x (5)
p p
(f − x)2 + y 2 + (f + x)2 + y 2
(6)
p p p
(f − x)2 + y 2 − (f + x)2 + y 2 = 2a − 2 (f + x)2 + y 2
2
Equation (5) was obtained applying conjugate binomial rule and simplifying. Equa-
tion (6) was obtained combining (1) and (3).
Using (5) and (6) we can further combine (3) and (1) and we get:
(7)
p
−4f x = 2a 2a − 2 (f + x)2 + y 2
(8)
p
= 4a2 − 4a (f + x)2 + y 2
(9)
p
−f x = a2 − a (f + x)2 + y 2
(10)
p
a (f + x)2 + y 2 = f x + a2
a2 f 2 + 2f x + x2 + y 2 = f 2 x2 + 2f xa2 + a4 (12)
a2 a2 − b2 + a2 x2 + a2 y 2 = a2 − b2 x2 + a4 (13)
a2 y 2 + b2 x2 = a2 b2 (14)
This is already the equation that we were looking for. Dividing by a2 b2 we can express
it in its most known form:
x2 y 2
+ 2 =1 (15)
a2 b
Note that in equation (15) we asume the center of the ellipse to be (0, 0). Instead, if
the center is of the form (h, k) we can simpy rewrite the equation as:
(x − h)2 (y − k)2
+ =1 (16)
a2 b2
3
3 Equation in polar coordinates
Now we will transform equation (15) to polar coordinates. We will use the usual equiv-
alences:
x = r cos θ (17)
y = r sin θ (18)
We will use equation (14) which is equivalent to (15). Now we substitute (17) and
(18) in (14) and we get:
ab
r=p (22)
b cos θ + a2 (1 − cos2 θ)
2 2
ab
=√ (23)
b cos θ + a2 − a2 cos2 θ
2 2
ab
=p (24)
(b2 − a2 ) cos2 θ + a2
Dening:
√
a2 − b2
e= (25)
a
We have:
ab
r=√ (26)
a2 − e2 a2 cos2 θ
ab
=p (27)
a2 (1 − e2 cos2 θ)
ab
= p (28)
a (1 − e2 cos2 θ)
b
=√ (29)
1 − e2 cos2 θ
4
Equation (29) is nally our equation in polar coordinates with center at the origin.
The new parameter e is called excentricity of the ellipse and is a measure of the
We can now transform (29) into its foci-centered form. Refering to gure (2), we will
derive the equation corresponding to f1 . The equation for f2 is analogue. Also, note that
the equation is equivalent to nd rf1 in function of θf1 . Having said that, we start with
(29) and we will nd an expression for cos θ. The steps to do this are shown in the next
equations:
b2
r2 =
(1 − e2 cos2 θ)
b2
1 − e2 cos2 θ =
r2
b2
e2 cos2 θ = 1 −
r2
r2 − b2
2 1 1
r2 − b2
cos θ = 2 =
e r2 e2 r 2
√
r2 − b2
cosθ = (30)
er
By cosines laws we have the following equation:
√
r2 − b2 2f p 2
rf21 2 2
= f + r + 2f r = f 2 + r2 + r − b2 (32)
er e
If we dene:
(33)
p
g= r2 − b2
5
2f
g2 + g + f 2 + b2 − rf21 = 0 (34)
e
And (34) can be solved for g using the cuadratic formula and:
A=1
2f
B=
e
C = f 2 + b2 − rf21
The step by step solution is shown below:
r 2
− 2f
e ± 2f
e − 4 f 2 + b2 − rf21
g= (35)
r 2
4f 2
e2
− 4 f 2 + b2 − rf21
f
=− ± (36)
e q 2
f2
f 2 e2 − f 2 − b2 + rf21
=− ± (37)
e q 2
= −a ± a2 − f 2 − b2 + rf21 (38)
q
= −a ± rf2 = −a ± rf1 (39)
f = ea (40)
Which can be obtained from (4) and (25).
6
0 = 2f (f − rf1 cosθf1 + rcosθ) (43)
As f 6= 0 we conclude that:
√
r2 − b2
f − rf1 cosθf1 + =0 (45)
e
Now we sustitute (39) in (45)
rf1 − a
f − rf1 cosθf1 + =0
e
−erf1 cosθf1 + (rf1 − a)
= −f
e
Using (40)
−erf1 cosθf1 + (rf1 − a)
= −ea
e
rf1 (1 − ecosθf1 ) = a 1 − e2
a 1 − e2
rf1 = (46)
1 − ecosθf1
Equation (46) is our polar equation of the ellipse with center in foci f1 .
7
5 Equation of the ellipse given two points and its corresponding slopes
In this section we will turn our attention to solve the problem specied in the section
title. Supose that we are given two points, p = (x1 , y1 ) and q = (x2 , y2 ) that are part of
an ellipse whose major semiaxis a is parallel to the X axis. We are also given the slopes
of the points m1 and m2 and we are asked to obtain the equation of such ellipse. This
means we need to obtain the coordinates of the center of the ellipse (h, k), the major and
minor semiaxes a and b and nally the excentricity e and the coordinates of the foci f1
and f2 .
As p and q are points of the ellipse, equation (16) will hold for x1 , y1 , x2 and y2 ,
which means that:
b2 (h − x1 )
m1 = (49)
a2 (y1 − k)
b2 (h − x2 )
m2 = (50)
a2 (y2 − k)
Equations (47), (48), (49) and (50) form a system of 4 equations with 4 unknowns.
Then it should be simple to nd an expression for each of the unknowns in function of
the parameters. Well we will soon realise it is not so simple. First we use (49) and (50)
to get:
b2 m1 (y1 − k) m2 (y2 − k)
2
= = (51)
a h − x1 h − x2
Now we multiply (47) by a2 and use (51)
2
a2 (y1 − k)
(x1 − h)2 + = a2 (52)
b2
(h − x1 ) (y1 − k)2
2
(x1 − h) + = a2 (53)
m1 (y1 − k)
8
And do the same thing for (48) and (51) and we get:
2
a2 (y2 − k)
(x2 − h)2 + = a2 (54)
b2
(h − x1 ) (y2 − k)2
(x2 − h)2 + = a2 (55)
m1 (y1 − k)
(x1 − h)2 m1 (y1 − k)+(h − x1 ) y12 − 2y1 k + k 2 = (x2 − h)2 m1 (y1 − k)+(h − x1 ) y22 − 2y2 k + k 2
m1 k (x2 − h)2 − (x1 − h)2 + 2k (h − x1 ) (y2 − y1 ) =
m1 y1 (x2 − h)2 − (x1 − h)2 − (h − x1 ) y12 − y22 (60)
Isolating k:
2 2
m1 y1 (x2 − h) − (x1 − h) − (h − x1 ) y12 − y22
k= (61)
m1 (x2 − h)2 − (x1 − h)2 + 2 (h − x1 ) (y2 − y1 )
9
kn = m1 y1 (x2 − h)2 − (x1 − h)2 − (h − x1 ) y12 − y22 (62)
kd = m1 (x2 − h)2 − (x1 − h)2 + 2 (h − x1 ) (y2 − y1 ) (64)
= m1 x22 − x21 + 2hm1 (x1 − x2 ) + 2h (y2 − y1 ) − 2x1 (y2 − y1 ) (65)
Now we sustitute (62) and (64) in (51) and do some self explanatory operations:
kn kn
m1 y1 − kd m2 y2 − kd
=
h − x1 h − x2
kd y1 −kn kd y2 −kn
m1 kd m2 kd
=
h − x1 h − x2
m1 (kd y1 − kn ) m2 (kd y2 − kn )
= (66)
h − x1 h − x2
We are now interested in knowing an expression for m1 (kd y1 − kn ) so we use (63)
and (65):
m1 (kd y1 − kn )
m1 x22 − x21 + 2hm1 (x1 − x2 ) + 2h (y2 − y1 ) − 2x1 (y2 − y1 ) y1
= m1
− m1 m1 y1 x22 − x21 + 2hm1 y1 (x1 − x2 ) − h y12 − y22 + x1 y12 − y22 (67)
m1 (kd y1 − kn )
= h 2m1 y 1 (y2 − y1 ) + m1 y12 − y22 − 2m1 x1 y1 (y2 − y1 ) − m1 x1 y12 − y22 (68)
Dening:
α = m1 y 1 (y2 − y1 ) (69)
We have that:
m1 (kd y1 − kn ) = (h (2α + β) − 2x1 α − x1 β) (71)
10
Multiplying by (h − x2 ):
(h − x2 ) (h (2α + β) − 2x1 α − x1 β)
= h2 (2α + β) − h (2x1 α + x1 β) − x2 h (2α + β) + x2 (2x1 α + x1 β)
This equation will be used later in the text. But before we can use it, we need to
obtain the analogue result for m2 (kd y2 − kn ). In order to get this we will need to perform
some extra operations with (63) and (65). The operations are shown below:
Dening:
11
(h − x1 ) (hm2 γ + δ) = h2 m2 γ + hδ − hm2 γx1 − x1 δ (77)
= h2 m2 γ + h (δ − m2 γx1 ) − x1 δ (78)
Now we equate (72) and (78) as they should be equal per (66):
A = m2 γ − 2α − β (79)
B = δ − m2 γx1 + 2x1 α + x1 β + x2 (2α + β) (80)
C = −x1 δ − x2 (2x1 α + x1 β) (81)
And then applying:
√
−B± B 2 −4AC
h= (82)
2A
Once we have h, k can be calculated with (61) and then a can be calculated with
(53) or (55). Then b can be obtained from (49) and, if needed, e and f can be obtained
from (40) and (4) respectively. Note how all the information is obtained from the initial
six given parameters.
x1 = −97.805435 (83)
x2 = −28.903954 (84)
y1 = 68.954878 (85)
y2 = 69.253958 (86)
m1 = tan 0.617190 (87)
m2 = tan 2.567920 (88)
12
Figure 3: Ellipse drawn in a CAD program using equations (83) to (88).
The values obtained are in agreement with the results of the function in listing (2).
13
21 case htest(1,2)
22 h=r(2);
23 case htest(2,1)
24 h=r(1);
25 case htest(2,2)
26 h=r(1);
27 end
28 knum=m1*y1*(x2^2−x1^2)+2*h*m1*y1*(x1−x2)−h*(y1^2−y2^2)+x1*(y1^2−y2^2);
29 kden=m1*(x2^2−x1^2)+2*h*m1*(x1−x2)+2*h*(y2−y1)−2*x1*(y2−y1);
30 k=knum/kden;
31 a=sqrt((x2−h)^2+((h−x1)*(y2−k)^2/(m1*(y1−k))));
32 %we also can use:
33 %a=abs((x1−h)/sin(atan((x1−h)/((y1−k)*sqrt((h−x1)/(m1*(y1−k)))))))
34 b=sqrt(m1*a^2*(y1−k)/(h−x1));
35 e=sqrt(a^2−b^2)/a;
36 f=e*a;
37 clear T;
38 T = table([h], [k], [a], [b], [e], [f]);
39 T.Properties.VariableNames = {'h', 'k', 'a', 'b', 'e', 'f'}
References
14