Sie sind auf Seite 1von 14

Brief study on the equation of an ellipse

Hugo Alberto Nieto Loredo

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

2 Equation in cartesian coordinates

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

Figure 1: A circle, a parabola and an ellipse


generated by cutting a cone from dierent planes.

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.

As p is a point of the ellipse, we have:

(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

Which leads to:

(10)
p
a (f + x)2 + y 2 = f x + a2

Raising to the square both sides we get:

a2 (f + x)2 + y 2 = f 2 x2 + 2f xa2 + a4 (11)




a2 f 2 + 2f x + x2 + y 2 = f 2 x2 + 2f xa2 + a4 (12)


Simplifying and using (4) we get:

a2 a2 − b2 + a2 x2 + a2 y 2 = a2 − b2 x2 + a4 (13)
 

Expanding and simplifying we nally get:

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:

b2 r2 cos2 θ + a2 r2 sin2 θ = a2 b2 (19)


Now we nd that an expression for r is:
ab
r=p (20)
b2 cos2 θ + a2 sin2 θ
Now we use the trigonometric identity:

sin2 θ = 1 − cos2 θ (21)


In (20) 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

4 Equation in polar coordinates. Center at one of the foci

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:

rf21 = f 2 + r2 − 2f rcos (π − θ) = f 2 + r2 + 2f rcosθ (31)


Now we sustitute (30) in (31) and we have:


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

We can sustitute (33) in (32) and the result will be:


2f
rf21 = f 2 + g 2 + b2 + g
e

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)

Where we have used (4) and also the fact that:

f = ea (40)
Which can be obtained from (4) and (25).

On the other hand, by law of cosines we also get:

r2 = f 2 + rf21 − 2f rf1 cosθf1 (41)


Equation (41) can be written as follows:

−rf21 = f 2 − r2 − 2f rf1 cosθf1 (42)


By adding (31) and (42) we get:

6
0 = 2f (f − rf1 cosθf1 + rcosθ) (43)
As f 6= 0 we conclude that:

f − rf1 cosθf1 + rcosθ = 0 (44)


Using cos θ from equation (30) we get:

r2 − b2
f − rf1 cosθf1 + r =0
er


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

−erf1 cosθf1 + (rf1 − a) = −e2 a

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

provided one of the semiaxis is parallel to X axis

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:

(x1 − h)2 (y1 − k)2


+ =1 (47)
a2 b2

(x2 − h)2 (y2 − k)2


+ =1 (48)
a2 b2
Now we proceed to implicitly derive equation (16). Using m1 and m2 for the slopes,
the results are:

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)

After combining (53) and (55) we are left:

(h − x1 ) (y1 − k)2 (h − x1 ) (y2 − k)2


(x1 − h)2 + = (x2 − h)2 + (56)
m1 (y1 − k) m1 (y1 − k)
2 2 (h − x1 ) y22 − 2y2 k + k 2
 
(h − x1 ) y1 − 2y1 k + k
2
(x1 − h) + 2
= (x2 − h) + (57)
m1 (y1 − k) m1 (y1 − k)

Myltiplying (57) by m1 (y1 − k) and exhaustivaley expanding:

(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
 

(x1 − h)2 m1 y1 − (x1 − h)2 m1 k + (h − x1 ) y12 − (h − x1 ) 2y1 k + (h − x1 ) k 2 =


(x2 − h)2 m1 y1 − (x2 − h)2 m1 k + (h − x1 ) y22 − (h − x1 ) 2y2 k + (h − x1 ) k 2 (58)

(x1 − h)2 m1 y1 − (x1 − h)2 m1 k + (h − x1 ) y12 − (h − x1 ) 2y1 k =


(x2 − h)2 m1 y1 − (x2 − h)2 m1 k + (h − x1 ) y22 − (h − x1 ) 2y2 k (59)

 
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 )

Now we dene kn and kd as follows:

9
 
kn = m1 y1 (x2 − h)2 − (x1 − h)2 − (h − x1 ) y12 − y22 (62)


= m1 y1 x22 − x21 + 2hm1 y1 (x1 − x2 ) − h y12 − y22 + x1 y12 − y22 (63)


  

 
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)
  

Grouping the h's we are left with:

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)

β = m1 y12 − y22 (70)




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 β)


= h2 (2α + β) − h (2x1 α + x1 β + x2 (2α + β)) + x2 (2x1 α + x1 β) (72)

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:

m1 x22 − x21 + 2hm1 (x1 − x2 ) + 2h (y2 − y1 ) − 2x1 (y2 − y1 ) y2


 
m2 (kd y2 − kn ) = m2
− m1 y1 x22 − x21 + 2hm1 y1 (x1 − x2 ) − h y12 − y22 + x1 y12 − y22
  

m2 m1 y2 x22 − x21 + 2hm1 y2 (x1 − x2 ) + 2hy2 (y2 − y1 ) − 2x1 y2 (y2 − y1 )



=
− m1 y1 x22 − x21 − 2hm1 y1 (x1 − x2 ) + h y12 − y22 − x1 y12 − y22
  

m2 h 2m1 y2 (x1 − x2 ) + 2y2 (y2 − y1 ) − 2m1 y1 (x1 − x2 ) + y12 − y22



=
+m1 y2 x22 − x21 − 2x1 y2 (y2 − y1 ) − m1 y1 x22 − x21 − x1 y12 − y22
  

hm2 2m1 y2 (x1 − x2 ) + 2y2 (y2 − y1 ) − 2m1 y1 (x1 − x2 ) + y12 − y22



=
+m1 m2 y2 x22 − x21 − 2m2 x1 y2 (y2 − y1 ) − m1 m2 y1 x22 − x21 − m2 x1 y12 − y22
  

Which nally leads to:

m2 (kd y2 − kn ) = hm2 (2m1 (x1 − x2 ) + 2y2 ) (y2 − y1 ) + y12 − y22




+ m1 m2 x22 − x21 − 2m2 x1 y2 (y2 − y1 ) − m2 x1 y12 − y22 (73)


  

Dening:

γ = (2m1 (x1 − x2 ) + 2y2 ) (y2 − y1 ) + y12 − y22 (74)




δ = m1 m2 x22 − x21 − 2m2 x1 y2 (y2 − y1 ) − m2 x1 y12 − y22 (75)


  

And sustituting (74) and (75) in (73) we get:

m2 (kd y2 − kn ) = hm2 γ + δ (76)


Multiplying by (h − x1 )

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):

h2 m2 γ+h (δ − m2 γx1 )−x1 δ = h2 (2α + β)−h (2x1 α + x1 β + x2 (2α + β))+x2 (2x1 α + x1 β)

h2 (m2 γ − 2α − β)+h (δ − m2 γx1 + 2x1 α + x1 β + x2 (2α + β))−x1 δ−x2 (2x1 α + x1 β) = 0

This last equation can be solved for h using:

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.

A Matlab function is shown in listing (1) as an example of the implementation of the


formulas. Also, to ilustrate the accuracy of the function, we compare it with an ellipse
drawn in a CAD program with test values from equations (83) to (88). The drawing
of the ellipse in gure (3) and the results of the function in listing (2) demonstrate the
accuracy of the values up to six decimal places.

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

Listing 1: Function to obtain the ellipse


1 function EllipseParam = EllipseTwoPointsTwoSlopes(x1,x2,y1,y2,m1,m2)
2 alf=m1*y1*(y2−y1);
3 bet=m1*(y1^2−y2^2);
4 gam=(2*m1*(x1−x2)+2*y2)*(y2−y1)+(y1^2−y2^2);
5 delt = m1*m2*(x2^2 − x1^2)*(y2 − y1) − 2*m2*x1*y2*(y2 − y1) − m2*x1*(y1^2
− y2^2);
6
7 A=m2*gam−2*alf−bet;
8 B=delt−m2*gam*x1+2*x1*alf+x1*bet+x2*(2*alf+bet);
9 C=−x1*delt−x2*(2*x1*alf+x1*bet);
10 p=[A B C];
11 r=roots(p);
12 htest(1,1)=abs(r(1)−x1);
13 htest(1,2)=abs(r(1)−x2);
14 htest(2,1)=abs(r(2)−x1);
15 htest(2,2)=abs(r(2)−x2);
16
17 small=min(htest(:));
18 switch small
19 case htest(1,1)
20 h=r(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'}

Listing 2: Results of the function are in agreement with gure (3)


1
2 >> EllipseTwoPointsTwoSlopes(−97.805435,−28.903954,68.954878,69.253958,tan
(0.617190),tan(2.567920))
3
4 T =
5
6 h = −63.1336889397506
7 k = 65.4066979615768
8 a = 37.087452059863
9 b = 9.99474731305449
10 e = 0.963002811696851
11 f = 35.7153206123203

References

[1] Murray R. Spiegel. Applied Dierential Equations Prentice-Hall Inc, 1983.

14

Das könnte Ihnen auch gefallen