Formula for analytical finding ellipse and circle intersection

zatajuxoqj

zatajuxoqj

Answered question

2022-03-24

Formula for analytical finding ellipse and circle intersection points if exist
I need a formula that will give me all points of random ellipse and circle intersection (ok, not fully random, the center of circle is laying on ellipse curve)
I need step by step solution (algorithm how to find it) if this is possible.

Answer & Explanation

Harry Gibson

Harry Gibson

Beginner2022-03-25Added 13 answers

Choose a coordinate system where the x axis is parallel to the ellipse major semiaxis, y axis parallel to the ellipse minor semiaxis, and origin where they intersect ("center of ellipse"). If a is the semi-major axis and b the semi-minor axis, and

(1a) x 2 a 2 + y 2 b 2 = 1

Assuming we have a nondegenerate ellipse (an ellipse with nonzero area), then a,b>0, and we can write above as

(1b) x 2 + a 2 b 2 y 2 a 2 = 0

A circle of radius r0 centered at x=x0,y=y0 fulfills

(2a) ( x x 0 ) 2 + ( y y 0 ) 2 = r 2

which we can also expand into 

(2b) x 2 2 x 0 x + y 2 2 y 0 y + x 0 2 + y 0 2 r 2 = 0

To find the point (x,y) where the circle and the ellipse intersects, you need to solve the pair of equations, for example (1b) and (2b).
The system of equations has essentially form

(3) {   x 2 + C 1 y 2 + C 2 = 0 x 2 + C 3 x + y 2 + C 4 y + C 5 = 0

where C1=a2b2,C2=a2,C3=2x0,C4=2y0,C5=x02+y02r2
One efficient way of solving (3) is to substract the first equation from the second, and solve for x. You'll find exactly one algebraic solution for x (that depends on y). Substitute it back into the first equation, and you have a quartic equation in y, which has zero, one, two, three, or four solutions. Solve that, then substitute the numeric value or values of y back into the algebraic solution for x, and you have the solution, which is either no intersection, one point of intersection, or two points of intersection.

Ashton Conrad

Ashton Conrad

Beginner2022-03-26Added 11 answers

Referring to the standard equation of the ellipse, x2a2+y2b2=1, choose the centre of the circle to correspond to the parameter value θ, so the equation of the circle with this centre and radius r is
(xacosθ)2+(ybsinθ)2=r2.
Let points of intersection of the circle with the ellipse have parameter values ϕ, so for a chosen θ, a, b and r you can find values of ϕ by solving
(acosϕacosθ)2+(bsinϕbsinθ)2=r2.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?