leopardGeckos
leopardGeckos

Reputation: 91

How to solve a system of vertical ellipses sharing the same center?

A program I'm writing needs to find the intersection point of two ellipses, both are vertical and share the same center. I only need the first solution of the four.

The values I can use to solve this are the radius of the vertical and horizontal components of each ellipse, or the 'a' and 'b' values, if you're using the standard equation for an ellipse. I've solved conic nonlinear systems before, but I have no idea how to take the algebraic idea and turn it into an algorithm.

This seems relatively simple, but I'm completely stuck. Sorry if this is a stupid question, but I would still appreciate an answer.

Upvotes: 0

Views: 391

Answers (2)

Skiminok
Skiminok

Reputation: 2871

Let's assume that you shifted the coordinate system in such a way that ellipses' center is in origin. Then both of your ellipses can be described using a canonical equation:

ellipse 1

ellipse 2

where a1, b1, a2, b2 are ellipses' respective parameters.

The only thing that is left is to solve this system of equations. For example, Wolfram|Alpha can do it for you (here I substituted c for a2 and d for b2).

Assuming your ellipses are non-trivial, one possible pair of solutions is:

enter image description here

enter image description here

There are other pairs, which have different +/- signs before the root.

Upvotes: 2

KCH
KCH

Reputation: 2854

Take ellipse equation in form (x/a)^2 + (y/b)^2 = 1 for both of your pairs (a,b), factor y^2 to the right, and make left sides equal:

(x*b1/a1)^2 - b1^2 = y^2   (1)
(x*b2/a2)^2 - b2^2 = y^2

This simplifies to:

(x*b1/a1)^2 - b1^2 = (x*b2/a2)^2 - b2^2 

A quadratic equation for x, which will give you at most two real solutions (x1,x2). The ellipse equation (1) with x1 plugged will give you two values of y (lets name them y1, y2). Your solutions are:

(x1, y1)
(x1, y2)
(x2, y1)
(x2, y2)

Of course, there can be less intersection points, but It is easy to determine, since some quadratic equations will have complex solutions.

Upvotes: 0

Related Questions