☖ Home Units Converter Geometry Σ Math Physics Electricity

Ellipse line intersection calculator

Print 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 when h ≠ 0 and k ≠ 0

Print midline calculator
Ellipse
Ellipse general equation is:
(x+h)^2/a^2 +(y+k)^2/b^2 =1

Line form:y = m x + c

The intersections x1,2 coordinates are:
x_(1,2)=(b^2 h-a^2 mφ±ab√(b^2+a^2 m^2-2mφh-φ^2-m^2 h^2 ))/(b^2+a^2 m^2 )
The intersection x1,2 coordinates are:
y1,2 = m x1,2 + c

Where:         φ = c + k

Notice that when
a2 m2 + b2 + 2hmφ − φ2 − m2 h2 = 0
Or
a2 m2 + b2 − (c + k + hm)2

The line will be tangent to the ellipse

Ellipse and line intersection when  h = 0  and  k = 0  summary

Ellipse
Ellipse general equation is:
General form of an ellipse with center at (0 , 0)

Line form:y = m x + c

The intersections x1,2 coordinates are:
x_1,2=(-a^2 mc±ab√(a^2 m^2+b^2-c^2 ))/(b^2+a^2 m^2 )
The intersection y1,2 coordinates are:
y_1,2=(b^2 c±abm√(a^2 m^2+b^2-c^2 ))/(b^2+a^2 m^2 )
Or y1,2 = m x1,2 + c

Ellipse and line intersection if x = 0 or y = 0

ellipse form:     (d+h)^2/a^2 +(y+k)^2/b^2 =1
Line form:   (vertical line)     x = d
x1,2 = d
y_1,2=-k±b/a √(a^2-(d+h)^2 )
ellipse form:     (x+h)^2/a^2 +(y+k)^2/b^2 =1
Line form:   (horizontal line)     y = d
y1,2 = d
x_(1,2)=h±a/b √(b^2-d^2-k^2+2dk)

Verify the equations of an ellipse and line intersection

Print verify the equation of an ellipse
Find the intersection points of an ellipse and a line with center at (h, k)
Ellipse
The ellipse equation is given by:
(x+h)^2/a^2 +(y+k)^2/b^2 =1 (1)
Line equation: y = mx + c (2)
The center of the ellipse is at  (h , k)
Substitute eq. (2) into eq. (1)
(x-h)^2/a^2 +(mx+c-k)^2/b^2 =1
Solving for x we have:
b2(x + h)2 + a2(mx + φ)2 − a2b2 = 0 where   φ = c + k
b2x2 + 2hb2x + b2h2 + a2m2x2 + 2a2mφx + a2φ2 − a2b2 = 0
x2(b2 + a2m2) + x(2a2mφ + 2hb2) + b2h2 + a2φ2 − a2b2 = 0
The solution of this quadratic equation is:
x_1,2=(b^2 h+a^2 mφ±√((a^2 mφ-b^2 h)^2-(b^2+a^2 m^2 )(b^2 h^2+a^2 φ^2-a^2 b^2 ) ))/(b^2+a^2 m^2 )
x_1,2=(b^2 h-a^2 mε±√(a^4 m^2 ε^2-2a^2 mεb^2 h+b^4 h^2-b^4 h^2-b^2 a^2 ε^2+b^4 a^2-a^2 m^2 b^2 h^2-a^4 m^2 ε^2+a^4 m^2 b^2 ))/(b^2+a^2 m^2 )
Finally, we get: x_(1,2)=(b^2 h-a^2 mφ±ab√(b^2+a^2 m^2-2mφh-φ^2-m^2 h^2 ))/(b^2+a^2 m^2 ) (3)
Once the coordinate of x1,2 are known we can find the y coordinates by substituting the v values into the equation of the line:
y1 = m x1 + c
y2 = m x2 + c

Numeric example of intersection between ellipse and line

Print numeric example of intersection of ellipse and line
Find the coordinates of the intersection of an ellipse given by the equation     (x-2)^2/9+(y+3)^2/36=1
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:
x_1,2=(36∙2-9∙0.5∙1.75±3∙6√(36+9∙0.25-2∙0.5∙1.75∙2-〖1.75〗^2-〖0.5〗^2∙4))/(36+9∙〖0.5〗^2 )
x_1,2=(64.125±18√30.6875)/38.25=(64.125±99.713)/38.25=4.28 ,-0.93
From the equation of the line, we can get the y coordinates: y=(2x-5)/4=0.5x-1.25
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:
y_1,2=(36∙(-0.25)+9∙0.25∙(-3)±6∙3∙0.5√(36+9∙0.25+2∙(-0.25)(-3)-9-0.0625))/(36+9∙0.25)
y_1,2=(-15.75±9√30.6875)/38.25=(-15.75±49.86)/38.25=0.89  -1.72
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) (x_1-2)^2/9+(y_1+3)^2/36=(4.28-2)^2/9+(-1.72+3)^2/36=0.623
Check point   (4.28 , 0.89) (x_1-2)^2/9+(y_2+3)^2/36=(4.28-2)^2/9+(0.89+3)^2/36=1
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)