Suppose we are working in the 3D Euclidean space. We are given an arbitrary point $p$ and a 2d ellipse:
$$E=\{x:x^TQx\leq1,x^Tq=0\},$$
where $Q$ is a positive definite matrix and $q$ is an eigenvector of $Q$.
Let us say we want to find the distance between $p$ and $E$, i.e., we want to solve
\begin{align} \min_{x\in E}&\|p-x\|_2^2.\\ \end{align}
This problem can be systematically solved via Lagrangian multipliers.
Are there any references, like papers or books, which solve exactly the same problem?
Let $p'$ be the orthogonal projection of $p$ onto the plane with the ellipse. For any $x\in E$ the Pythagorean theorem gives $\|p-x\|^2=\|p-p'\|^2+\|p'-x\|^2$. Therefore, the problem reduces to minimizing $\|p'-x\|^2$, which is a two-dimensional problem. You can find the formula for the minimizing point $x$ here and here. These posts are about the distance to the boundary of the ellipse. Since you consider the distance to filled-in ellipse, there is one more thing to check: if $p'$ is inside the ellipse, then $x=p'$.