20 years later need geometry IRL - Solving an ellipse to pass through 2 points. I have a line as a tangent passing through each point. This is an IRL problem. I'm working in an architecture studio and trying to build an object using gdl (geometric descriptive language) code that would draw a curved ramp with different width at the top and bottom for any given angle of the ramp. In a simple case, one side of the ramp can be an arc of a circle but the other would be an ellipse. In a more complex variant, neither would be an arc of a circle. I believe this should not make a difference as it would be simply solving two equations that are independent of one another.
With given the top and bottom widths, outer radius and angle as known variables, how could I solve this?
90 degree ramp:

60 degree ramp:

 A: Place the origin where "Bottom Tangent" meets "Bottom Width" and any ellipse has equation $$\left(\frac{x-a}a\right)^2+\left(\frac y b\right)^2=1$$
You know you want this ellipse to pass through a certain point. In your second diagram it is $\Big(5000-8000\cos(60^{\circ}),8000\sin(60^{\circ})\Big)=\big(1000,4000\sqrt{3}\big)$. If you plug this in for $(x,y)$ you get a relation between $a$ and $b$.
Also taking $\frac12\frac{d}{dx}$, we get
$$\frac{x-a}{a^2}+\frac {yy'} {b^2}=0$$
Plug in the same point for $(x,y)$. Also at that location, for tangency you want $y'=\tan(30^{\circ})=\frac{1}{\sqrt{3}}$. Now you have a second relation in $a$ and $b$. You can solve the system of two equations in $a$ and $b$ and have a cartesian equation for the ellipse.

To demonstrate in the specific case of your second diagram,
$$
\left\{
\begin{aligned}
\left(\frac{1000-a}a\right)^2+\left(\frac{4000\sqrt{3}}{b}\right)^2
&=1\\
\frac{1000-a}{a^2}+\frac {4000} {b^2}
&=0
\end{aligned}\right.
$$
The second equation lets you isolate $b^2$ and sub it into the first equation to get
$$\left(\frac{1000-a}a\right)^2+\frac{12000(a-1000)}{a^2}
=1$$
$$\implies\left(1000-a\right)^2+12000(a-1000)
=a^2$$
$$\implies a=1100$$
From which:
$$\frac{1000-1100}{1100^2}+\frac {4000} {b^2}=0$$
$$\implies\frac {4000} {b^2}=\frac{100}{1100^2}$$
$$\implies b=2200\sqrt{10}$$
So with the origin where I placed it, your second diagram's ellipse is
$$\left(\frac{x-1100}{1100}\right)^2+\left(\frac{y}{2200\sqrt{10}}\right)^2=1$$
Here is that solution alongside your outer circle and $60^{\circ}$ line, plotted using GeoGebra.

If you want to generalize this beyond your second diagram, you can study you to replace the numbers ($5000$, $8000$, $60^{\circ}$, etc.) with general parameters.
A: Because the outer and inner radiuses are the exact same problem, we only need to find a parametric solution to one to solve both.  Instead of "bottom" and "top", we'll use "wide" and "narrow", because the direction does not matter, but the order of the two radii does.  We'll choose the coordinate system so that the wide part starts at the positive $x$ axis.  (While technically this flips the illustrations horizontally, due to symmetries it does not matter; the parameters stay exactly the same.)
Let's call $R$ the wide radius (bottom radius), and $r$ the narrow radius (top radius), with $R \ge r$.  The angle is $\theta$, limited to between $0°$ and $180°$.
We now have an ellipse with one semiaxis on the $x$ axis, and the other on the $y$ axis.  Using the standard equation of the ellipse,
$$\frac{x^2}{R^2} + \frac{y^2}{H^2} = 1 \tag{1}\label{1}$$
where $H$ is the unknown; the point (x, y) at angle $\theta$ being
$$\frac{y}{x} = \tan\theta \tag{2}\label{2}$$
and the distance to origin there is $r$,
$$x^2 + y^2 = r^2 \tag{3}\label{3}$$
we have everything we need for a single curve.
Here comes the math part.
Equation $\eqref{3}$ is equivalent to $y^2 = r^2 - x^2$.  Substituting this into equation $\eqref{1}$ gives us
$$\frac{x^2}{R^2} + \frac{r^2 - x^2}{H^2} = 1 \tag{4}\label{4}$$
Equation $\eqref{2}$ is equivalent to $y = x \tan \theta$, which we can square on both sides to get $y^2 = x^2 (\tan \theta)^2$.  Substituting this into equation $\eqref{3}$ gives us
$$\begin{aligned}
x^2 t^2 &= r^2 - x^2 \\
x^2 \bigl( 1 + (\tan \theta) \bigr) &= r^2 \\
x^2 &= \frac{r^2}{1 + (\tan \theta)^2} \\
\end{aligned}$$
and finally
$$ x^2 = \frac{r^2}{m^2}, \quad m^2 = 1 + (\tan \theta)^2 \tag{5}\label{5}$$
where $m^2$ is just a positive constant, at least 1, only depending on $\theta$.  At $\theta = 90°$, $x^2 = 0$.
Substituting equation $\eqref{5}$ into equation $\eqref{4}$ yields
$$\begin{aligned}
\frac{r^2}{R^2 m^2} + \frac{r^2 - \frac{r^2}{m^2}}{H^2} &= 1 \\
\frac{r^2 - \frac{r^2}{m^2}}{H^2} &= 1 - \frac{r^2}{R^2 m^2} \\
\frac{r^2 - \frac{r^2}{m^2}}{H^2} &= \frac{R^2 m^2 - r^2}{R^2 m^2} \\
H^2 &= \left(r^2 - \frac{r^2}{m^2}\right) \frac{R^2 m^2}{R^2 m^2 - r^2} \\
H^2 &= r^2 \frac{R^2 m^2 - R^2}{R^2 m^2 - r^2} \\
\end{aligned}$$
Since $R^2 m^2 - R^2 = R^2 (m^2 - 1) = R^2 (\tan \theta)^2$, the solution for $H$ is
$$H = \begin{cases}
\frac{R ~ r \tan \theta}{\sqrt{ R^2 \bigl( 1 + (\tan \theta)^2 \bigr) - r^2 }}, 0 \le \theta \lt 90° \\
r, \theta = 90° \\
\frac{R ~ r \tan \theta}{\sqrt{ R^2 \bigl( 1 + (\tan \theta)^2 \bigr) - r^2 }}, 90° \lt \theta \lt 180° \\
\end{cases} \tag{6}\label{6}$$
This fully specifies the elliptical arc.  The semiminor radius on the $x$ axis is $R$, and the semiminor radius on the $y$ axis is $H$, given by above equation $\eqref{6}$.

Personally, I prefer cubic arcs, especially Bézier curves.
Here, you have two points with fixed tangents as the cubic Bézier curve, so there are just two free parameters, the lengths of the initial and final tangents.  The obvious choice for these would be the values that yield the nicest distance curve from origin (center axis), preferably monotonic.  While I can easily program a numerical search, I don't know how to analytically even describe the solution.
Using the above definitions, the four control points $\vec{P}_0$ through $\vec{P}_3$ are
$$\vec{P}_0 = (R, 0), \quad
\vec{P}_1 = (0, u), \quad
\vec{P}_2 = (c r - v s, s r + v c), \quad
\vec{P}_3 = (c r, s r)$$
where $u$ and $v$ are the unknown parameters, $R$ and $r$ are as above, $c = \cos\theta$, and $s = \sin\theta$.  The Bézier curve itself is parametrised using $t = 0 \dots 1$ via
$$\vec{P}(t) = (1-t)^3 \vec{P}_0 + 3 (1-t)^2 t \vec{P}_1 + 3 (1-t) t^2 \vec{P}_2 + t^3 \vec{P}_3$$
The distance from origin -- the parameter we want to smoothly decrease from $R$ at $t=0$ to $r$ at $t=1$ –– has form
$$d(t) = \left\lVert \vec{P}(t) \right\rVert = \sqrt{C_6 t^6 + C_5 t^5 + C_4 t^4 + C_3 t^3 + C_2 t^2 + C_1 t + C_0}$$
(omitting the constants $C_0$ through $C_6$, since they're a bit long, but easily calculated using Maxima, Maple, or SageMath), but we'd want it to be as close to $d(t) \approx (1-t) R + t r = R + t (r - R)$ as possible, for a single curve.
For an inner-outer curve pairs, there are four free parameters ($u$ and $v$ per curve), and more criteria to get a pleasing curve; specifically, the "width" between the curves is no longer measured along a line passing through origin, and usually it is more pleasing to have that change in a linear, smooth manner, which means qualitatively evaluating the pair of curves is much harder.
That said, for something like a foot path or paved area, an ellipse is much easier, as you can easily calculate the positions of the two focal points (they're symmetric and perpendicular to the wide part), so that a specific-length loop of string can be used to exactly draw the elliptical arc for each curve.  Might be useful trick for practical landscaping.
