Problem
Let $\mathcal C = \{ X \in \mathbb{R}^n \mid g(X) \leq 0\}$ where $g$ is convex, and let $X_c \in \mathcal{C}$. Is there any algorithm to compute the distance from $X_c$ to the boundary of $\mathcal{C}$ ? This can be formulated like the following optimization problem:
$$ \min_{X\in \mathbb{R}^n} \hspace{0.5cm} (X-X_c)^\top\cdot (X - X_c) \quad \text{s.t} \quad g(X) = 0 $$ or even worse:
$$ \min_{X\in \mathbb{R}^n} \hspace{0.5cm} (X-X_c)^\top\cdot (X - X_c) \quad \text{s.t} \quad g(X) \geq 0 $$ which is a minimization of a convex function over a concave domain.
Question
Are there any known algorithms for this problem? Is the distance from point to boundary convex in general?
Update
Indeed, based on the answer of @batwing below it is enough to solve: \begin{align}\max &\quad r\\\text{s.t}&\quad g(X_c + r\cdot u) \leq 0\\&\quad\forall \|u\| \leq 1\end{align} which is an infinite programming problem (it has an infinity of constraints). One can reformulate this in the following way: \begin{align}\max&\quad r\\\text{s.t}&\quad g(X_c + r\cdot u) \leq 0\\&\quad\|u\| \leq 1\end{align} which is unfortunately not convex in variables $u$ and $r$.