# How to express by a single equation a region delimited by confocal ellipse and hyperbola

I am trying to find the equation of a shape formed by a conic (ellipse) that excludes its intersection with another conic (hyperbola). The hyperbola and ellipse are assumed to share common foci. But they are general conics in 2D which means they can be rotated about the z-axis and translated along x and y axes. As it can be seen in the figure, the conics are rotated by an angle theta and not centered at the origin.

In the figure, I want the equation of resulting shape shown in grey shade (formed by the two conics). This new shape can be shown as follows:

Please let me know if it is possible to get an equality representing this new shape in the quadratic form as follows:

$$Ax^{2}+Bxy+Cy^{2}+Dx+Ey+F=0$$

• Is it parabola? In the drawing it looks like hyperbola. – Moti Feb 5 at 19:43
• Also be clear that you create an ellipsoid by rotating around the great axis of both (if this is the case) – Moti Feb 5 at 19:45
• Sorry, I meant hyperbola, and the equation of rotated ellipse can be found here (en.wikipedia.org/wiki/Ellipse#rotated). But in general it can be any conic section. – Kashish Dhal Feb 5 at 20:45
• @KashishDhal: Are you seeking a formula for the area of the shaded region? – Blue Feb 5 at 20:46
• No I am looking for the equation of conic (quadratic equation in x,y,z) that can represent a conic given by the shaded region – Kashish Dhal Feb 5 at 21:32

You are looking for the equation of curve having the shape of a double-sided axe (with greek and medieval connections https://en.wikipedia.org/wiki/Labrys) with alternate elliptical/hyperbolic boundaries.

An answer is brought by the following general second degree equation with an absolute value

$$x^2+k|y^2-1|=k^2 \tag{1}$$

with a "behavorial change" when variable $$y$$ crosses the value $$y=1$$ or $$y=-1$$ as can be seen on the following graphics for different values of $$k$$:

Fig. 1: Curves with equation (1) for different values of $$k$$. The most internal one is for $$k=0.25$$ : the most external one is for $$k=2$$, with steps $$0.25$$. For our question, only the values $$k>1$$ (blue curves) make sense.

It remains now to tilt the "axe" using the following coordinates change in (1):

$$\begin{cases}x&=& \ \ \ (\cos \theta) X + (\sin \theta) Y \\ y&=&-(\sin \theta) X + (\cos \theta) Y \end{cases}$$

(It looks like a pun: a change of axes inducing a different axe...)

Remarks:

1. The fact that we must take $$k^2$$ on the RHS is a consequence of calculations I have done to ensure that the ellipse and the hyperbola have common foci ; these computation are based on classical formulas ; more precisely, if $$f$$ is common distance from the origin to the foc, it is known that $$f^2=a^2-b^2$$ for an ellipse and $$f^2=a^2+b^2$$ for a hyperbola with canonical equation $$\dfrac{x^2}{a^2}\pm\dfrac{y^2}{b^2}=1$$ ; one obtains in particular $$f=\sqrt{k^2-1}$$.

2. One can notice that the elliptical arcs are orthogonal to the hyperbolic arcs.

3. Case $$k=1$$ is very particular: the ellipse is reduced to a circle... Edit: Here is the Matlab program I have written for the generation of the figure:

clear all;close all;hold on;axis equal
for k=0.25:0.25:2;
c='r';
if k>1;c='b';end;
e=ezplot([num2str(k),'*abs(y^2-1)+x^2-',num2str(k^2)]);
get(e);set(e,'linecolor',c);
end;
u=2.5;plot([-u,u],[0,0],'k','linewidth',1.5);
v=2;plot([0,0],[-v,v],'k','linewidth',1.5);
• Hello Jean, thanks, is it possible to get an equation without absolute or "behavorial change"? – Kashish Dhal Feb 7 at 0:28
• 1) I have changed the equation and the figure: now the foci are the same... 2) A second degree equation without absolute values $ax^2+2bxy+cy^2+...$ gives always an "ordinary smooth conic curve" without sudden changes like the curves you want to obtain... – Jean Marie Feb 7 at 0:39
• Okay, thanks, I have accepted your answer! Thanks for the help! – Kashish Dhal Feb 7 at 0:48
• I have changed the form of my text and the figure: you can see in particular the interesting red curves (even if they aren't those that you are looking for). – Jean Marie Feb 7 at 10:33
• I think I have it now for three independent parameters (which includes the freedom to vary $f$). I have written this up in another answer. – David K Feb 7 at 18:45

I guess you need inequalities describing the region.

Take $$a>c>b>0$$, for solid of revolution about the $$x$$-axis:

• Internal region bounded by an ellipsoid:

$$A=\left \{(x,y,z) \in \mathbb{R}^3: \frac{x^2}{a^2-c^2}+\frac{y^2+z^2}{c^2} \le 1 \right \}$$

• Middle region bounded by branches of a hyperboloid:

$$B=\left \{(x,y,z) \in \mathbb{R}^3: \frac{x^2}{c^2-b^2}-\frac{y^2+z^2}{b^2} \le 1 \right \}$$

• The shaded region is $$A\cap B$$ or equivalently,

$$b^2-\frac{b^2 x^2}{c^2-b^2} \le y^2+z^2 \le c^2-\frac{c^2 x^2}{a^2-c^2}$$

• Intersection of two conics (of revolution):

$$\textstyle \partial A \cap \partial B= \left \{ (\xi,\eta,\zeta) \in \mathbb{R}^3: (\xi^2,\eta^2+\zeta^2)= \left( \frac{(a^2-c^2)(c^4-b^4)}{a^2 b^2+c^4-2b^2 c^2}, \frac{b^2 c^2(a^2+b^2-2c^2)}{a^2 b^2+c^4-2b^2 c^2} \right) \right \}$$

For solid of revolution about the $$y$$-axis is left as an exercise.

• Hello Ng, thanks for the answer but I guess this is not what I was looking for. I am looking for the equation of a shape in 2D formed by the two conics. I have updated the question so that you may be able to follow what I mean to say. – Kashish Dhal Feb 6 at 22:46

Let $$a$$ and $$b$$ respectively be half the lengths of the major and minor axes of the ellipse. Let $$A$$ and $$B$$ respectively be half the lengths of the transverse and conjugate axes of the hyperbola. Let $$f$$ be half the distance between the foci, which are the same points for both the ellipse and the hyperbola. Then \begin{align} a^2 &= f^2 + b^2, \\ A^2 &= f^2 - B^2, \end{align} which implies that $$a > f$$ and $$B < f.$$ (All distance measurements are non-negative.)

The equation of the ellipse is $$\frac{x^2}{a^2} + \frac{y^2}{b^2} - 1 = 0 \tag1$$ and the equation of the hyperbola is $$\frac{x^2}{A^2} - \frac{y^2}{B^2} - 1 = 0. \tag2$$

The desired curve satisfies Equation $$(1)$$ when $$\frac{x^2}{A^2} - \frac{y^2}{B^2} < 1$$ and satisfies Equation $$(2)$$ when $$\frac{x^2}{a^2} + \frac{y^2}{b^2} < 1.$$

Inspired by the clever solution in another answer, we may try to unify the two equations by first setting the $$x^2$$ terms equal. For the ellipse we get $$x^2 + \frac{a^2}{b^2} y^2 - a^2 = 0 \tag3$$ and for the hyperbola $$x^2 - \frac{A^2}{B^2} y^2 - A^2 = 0. \tag4$$ The "average" of these equations (taking half the sum of the left-hand sides of $$(3)$$ and $$(4)$$) is $$x^2 + \frac12\left(\frac{a^2}{b^2} - \frac{A^2}{B^2}\right) y^2 - \frac12 (a^2 + A^2) = 0 \tag5$$ and "half the difference" of these equations (taking half the difference of the left-hand sides of $$(3)$$ and $$(4)$$) is $$\frac12\left(\frac{a^2}{b^2} + \frac{A^2}{B^2}\right) y^2 - \frac12 (a^2 - A^2) = 0. \tag6$$

Equation $$(3)$$ is then the "sum" of Equations $$(5)$$ and $$(6)$$ and Equation $$(4)$$ is the "difference", subtracting $$(6)$$ from $$(5).$$

But if we add the absolute value of the left side of $$(6)$$ to the left side of $$(5)$$, we get $$\begin{multline} \qquad x^2 + \frac12\left(\frac{a^2}{b^2} - \frac{A^2}{B^2}\right) y^2 - \frac12 (a^2 + A^2) \\ + \left\lvert \frac12\left(\frac{a^2}{b^2} + \frac{A^2}{B^2}\right) y^2 - \frac12 (a^2 - A^2) \right\rvert = 0 \qquad \tag7 \end{multline}$$

Observe that when $$\left(\frac{a^2}{b^2} + \frac{A^2}{B^2}\right) y^2 \geq (a^2 - A^2)$$, Equation $$(7)$$ matches Equation $$(5)$$ and therefore follows the path of the ellipse, but when $$\left(\frac{a^2}{b^2} + \frac{A^2}{B^2}\right) y^2 \leq (a^2 - A^2)$$, Equation $$(7)$$ matches Equation $$(6)$$ and therefore follows the path of the hyperbola. When $$\left(\frac{a^2}{b^2} + \frac{A^2}{B^2}\right) y^2 = (a^2 - A^2)$$, Equation $$(7)$$ matches both $$(5)$$ and $$(6)$$ simultaneously and it determines the intersections of the ellipse and hyperbola. That is, this is exactly the equation we want when the two foci are on the $$x$$ axis and are equidistant from the origin.

Note that since $$a$$ is a function of $$f$$ and $$b$$ and since $$A$$ is a function of $$f$$ and $$B$$, we can express the two equations using just three variables (and should do so, in order to ensure the same foci): $$f$$, $$a$$, and $$A$$; $$f$$, $$b$$, and $$B$$; or some other combination of three of the five variables. As long as we choose three mutually independent variables we can set them to whichever values we like (under the constraints $$a > f$$ and $$B < f$$) and derive the other two. For example, we could choose the length and width of the ellipse ($$2a$$ and $$2b$$) and the distance $$2A$$ between the vertices of the hyperbola, under the constraint that $$A^2 < a^2 - b^2.$$

If we choose $$f,$$ $$b,$$ and $$B$$ such that $$b^2 = 1 + \sqrt{f^2 + 1}$$ and $$B^2 = b^2 - 2,$$ then Equation $$(7)$$ becomes $$x^2 + \left(\sqrt{f^2 +1}\right) \left\lvert y^2 - 1\right\rvert - (f^2 + 1) = 0,$$ the same equation found in the answer that inspired this one.

For a curve at any other location and orientation in the plane, we can replace $$x$$ and $$y$$ with linear combinations of $$x$$ and $$y$$ that translate and rotate the figure as required. We then get an equation in which the sum of one quadratic polynomial in $$x$$ and $$y$$ and the absolute value of another quadratic polynomial in $$x$$ and $$y$$ is equal to zero.

• Very interesting... – Jean Marie Feb 7 at 22:02
• Thanks @David, looks interesting! – Kashish Dhal Feb 8 at 2:56
• Hello David, is it possible to get a parametrized version of this equation? I am trying to draw it in Matlab and that will help! – Kashish Dhal Mar 5 at 20:27