How to find the parabola that is tangent to two parabolas

99 Views Asked by At

Here is an example: https://www.desmos.com/calculator/h37wzmwdww

I have: points at x1 = 0 and x2 = 90; two parabolas with a1, b1, c1, a2, b2, c2.

I need the parabola a, b, c that is tangent to both parabolas at x1 and x2.

b=b1, c=c1, but how to get a?

The example:

a1 = 3.0133
b1 = -233.58
c1 = 20094
a2 = 1.7638
b2 = -322.83
c2 = 25406
1

There are 1 best solutions below

1
On BEST ANSWER

You have two given parabolas, which can be represented by the implicit algebraic equations:

$ A_1 x^2 + B_1 x y + C_1 y^2 + D_1 x + E_1 y + F_1 = 0 \tag{1}$

and

$ A_2 x^2 + B_2 x y + C_2 y^2 + D_2 x + E_2 y + F_2 = 0 \tag{2}$

You also have two known points $(x_1, y_1)$ on the first parabola, and $(x_2, y_2)$ on the second parabola. Now you want to construct a third parabola whose equation can be written as

$ A x^2 + B x y + C y^2 + D x + E y + F = 0 \tag{3}$

And you want $(x_1, y_1)$ and $(x_2, y_2)$ to lie on this parabola. This implies that we want

$ A x_1^2 + B x_1 y_1 + C y_1^2 + D x_1 + E y_1 + F = 0 \tag{4}$

$ A x_2^2 + B x_2 y_2 + C y_2^2 + D x_2 + E y_2 + F = 0 \tag{5}$

These are two linear equations in the unknown coefficients. In addition you want the slope of the tangent to parabola $(3)$, to match the slope of the tangent to parabola (1) at $(x_1, y_1)$. To calculate the slope of the tangent, differentiate implicitly with respect to $x$ and let the slope of the tangent be $y'_1$, then

$ 2 A_1 x_1 + B_1 (y_1 + x_1 y'_1) + 2 C_1 y_1 y'_1 + D_1 + E_1 y'_1 = 0 \tag{6} $

From which we can calculate $y'_1$ as

$ y'_1 = - \dfrac{ 2 A_1 x_1 + B_1 y_1 + D_1 }{ B_1 x_1 + 2 C_1 y_1 + E_1 } \tag{7}$

Differentiate the second equation. Evaluating at $(x_1,y_1)$, and setting the slope of its tangent be $y_1'$ we get

$ 2 A x_1 + B (y_1 + x_1 y'_1) + 2 C y_1 y'_1 + D + E y'_1 = 0 \tag{8} $

And similarly for the second parabola at $(x_2, y_2)$, we have

$ y'_2 = - \dfrac{ 2 A_2 x_2 + B_1 y_2 + D_2 }{ B_2 x_2 + 2 C_2 y_2 + E_2 } \tag{9}$

Therefore,

$ 2 A x_2 + B (y_2 + x_2 y'_2) + 2 C y_2 y'_2 + D + E y'_2 = 0 \tag{10} $

Equations $(4),(5), (8), (10)$ are four equations in $6$ unknowns. Solving the linear system gives

$ [A,B,C,D,E,F]^T = t X_1 + s X_2 $

where $X_1$ and $X_2$ are $6 \times 1$ vectors that have been determined by the linear system solver, and $t, s \in \mathbb{R}$.

Since scaling does not alter the equation of the parabola, we can assume that $t = 1$, then

$ [A,B,C,D,E,F] = X_1 + s X_2 $

To find $s$, we have to impose the condition on $A,B,C$ which is

$ B^2 - 4 AC = 0 $

And this will give two possible values for $s$. One of the $s$'s is the right one resulting in a parabola, while the other results in an equation of a degenerate conic that is a straight line passing through the two given points.

Here's an example of two parabolas (red and blue) with selected tangency points on them (yellow). Using the above procedure, the green tangent parabola is generated.

enter image description here