﻿ Ellipse line intersection
 Ellipse line intersection calculator ▲
Ellipse equation
 x2 + y2 + x + y + = 0
 (x − )2 + ( y − )2 = 1 2 2
Line equation of the form     mx + ny + c = 0
 x + y + = 0
 Intersection coordinates: Notes and input limit
 Ellipse and line intersection summary ▲
 Ellipse and line general equations Line equation:       y = mx + c Intersection points as a function of  h, k  and  c  are:
If         h = 0,       k = 0,       c = 0
ellipse form: Line form: y = m x  Or y1,2 = m x1,2
If         h = 0,       k = 0,       c ≠ 0
ellipse form: Line form: y = m x + c  Or      y1,2 = m x1,2 + c
If         h ≠ 0,       k ≠ 0,       c ≠ 0
ellipse form: Line form: y = m x + c  Or             y1,2 = m x1,2 + c Where:         φ = c − k         and         μ = c + m h
If         h ≠ 0,       k ≠ 0,       c ≠ 0,       x = d
ellipse form: Line form: x = d
(vertical line) x1,2 = d
If         h ≠ 0,       k ≠ 0,       c ≠ 0,       y = d
ellipse form: Line form: y = d
(horizontal line) y1,2 = d
 Verify the equations of an ellipse and line intersection ▲
Find the intersection points of an ellipse and a line The ellipse equation is given by: (1) Line equation: y = mx + c (2) The center of the ellipse is at  (h , k) Substitute eq. (2) into eq. (1) Solving for x we have:
 b2(x − h)2 + a2(mx + φ)2 − a2b2 = 0 where   φ = c − k b2x2 − 2hb2x + b2h2 + a2m2x2 + 2a2mφx + φ2 − a2b2 = 0 x2(b2 + a2m2) + x(2a2mφ − 2hb2) + b2h2 + φ2 − a2b2 = 0
 The solution of this quadratic equation is:  Finally we get: (3)
Note: for each  x  value there are two possible  y  coordinates but only one coordinate is on the ellipse see the red points in the drawing, if we find the numeric values of  x  and substitute it in the  y  equation we get otomatically the correct  y  coordinate. If we use the general equation for  y  as found below we have to check the correct  y  coordinate for each  x.
 To find the  y  intersection coordinates we substitutes into equation  (1). For ease of calculations we denot         μ = c + m h
 b2 (y − μ)2 + a2 m2 (y − k)2 − a2 m2 b2 = 0 b2 y2 − b2 2yμ + b2 μ22 + a2 m2 y2 − a2 m2 2yk + a2 m2 k2 − a2 m2 b2 = 0 y2 (b2 + a2 m2) − y(2b2 μ + 2a2 m2 k) + b2 μ2 + a2 m2 k2 − a2 m2 b2 = 0
Solving this quadratic equation and denote:       Φ = b2 μ2 + a2 m2 k2 − a2 m2 b2       we get: Finally we get: (4)
We could simply substitute the values of   x1,2   into equation   (2)     y = mx + d     and get imidiatlly the correct values of   y1   and   y2
 Numeric example of intersection between ellipse and line ▲
 Find the coordinates of the intersection of an ellipse given by the equation and the line given by    2x − 4y − 5 = 0
From the equation of the ellipse we can see that   a < b   so the ellipse is a vertical ellipse with vertices at:
 the y axis at: (h , k −b) → (2 , −3 − 6) → (2 , −9) and (h , k + b) → (2 , −3 + 6) → (2 , 3)
We have             φ = c − k = −5/4 + 3 = 1.75            m = 0.5            a = 3   and   b = 6
Solving equation   (3)   for   x1,2   we get:  From the equation of the line we can get the y coordinates: y1 = 0.5 · 4.28 − 1.25 = 0.89 y2 = 0.5 · (−0.93) − 1.25 = −1.72
And the intersection coordinates are:       (4.28 , 0.89)     and     (0.93 , −1.72)
If we find the y coordinates according to equation (4) we get:  Now we have to decide which  y  is the correct value for each  x  coordinate because the intersection point for example can be:   (4.28 , 0.89)   or   (4.28 , −1.72) for that reason the better method to solve  y  coordinate is by using the value of  y  in the line equation as described before.
Now we have to check which pair of intersection point is located on the ellipse contour.
 Check point   (4.28 , −1.72) Check point   (4.28 , 0.89) We clearly see that the correct intersection point is:   (4.28 , 0.89) and the second point is the remaining coordinates   (0.93 , −1.72)