# Smooth intersection between a parabola and a circle

The situation is as follows:

there's a circle of center $(0,0)$ and radius $r$, along with parabola having vertex $(0, 5/3r)$ that points downwards $(a < 0, b = 0)$.

I'm asked to find a curve that is given by the parabola and the circle arc, such that the intersection between the two is smooth. It roughly looks like an egg.

Given the previous information, we can derive the parabola equation $$y_p=ax^2+\frac{5}{3}r$$ and the circle $$x^2+y^2=r^2$$ Since the intersection happens in the positive part of the circle, we can express it as $$y_c=\sqrt{r^2-x^2}$$ Now, since the intersection is smooth, the tangents to both curves in their intersection point $P$ is supposed to be the same. And this is where things start going downhill. The intersection can be expressed as $$ax_P^2+\frac{5}{3}r=\sqrt{r^2-x_P^2}$$ and since the derivative at the point of intersection is the same, we can also say that $$2ax_P=\frac{-x_P}{\sqrt{r^2-x_P^2}}$$ However, it doesn't seem like the two equations produce any useful information. Any calculation that comes out of this is quite convoluted - and in cases where you have two opposite solutions, it's unclear whether the negative or the positive should be chosen.

By symmetry, the endpoints of the arc and our outer control points are $P_0=(r\cos\theta, r\sin\theta)$ and $P_2=(-r\cos\theta,r\sin\theta)$. The middle control point is the intersection of the mutual tangents to the circle and parabola at these two points, which with a little work can be found to be $P_1 = (0,r\csc\theta)$. The Bézier parameterization of this parabolic arc is $(1-t)^2P_0+2t(1-t)P_1+t^2P_2$ and again by symmetry the vertex is at $t=\frac12$. Equating the resulting point to $(0,5/3 r)$ will give you a quadratic equation in $\sin\theta$.