Let $A \subset \mathbb{S}^n$ be a spherical cap. More specifically, there exists a point $v \in \mathbb{S}^n$ and $\epsilon > 0$ such that $A = \{u \in \mathbb{S}^{n}\mid v\cdot u \geq \epsilon\}$.
Given some point $w \in \mathbb{S}^n$, I would like to find point in $A$ which minimizes the distance to $w$. If $w$ is not $A$, such a point would need to lie on the boundary of $A$.
I've tried solving this analytically, but it results in quite an ugly formula. I'm wondering if there's any known closed form solution to the problem.
Thanks.
For a point $w \in \mathbb{S}^{n}$ denote by $u$ the the vector orthonormal to $v$ which lies on the great circle connecting $w$ to $v$. Explictly, $u' = w - (w,v)v$ and $u = \frac{u'}{|u'|}$.
Now, on one hand, the point closest to $w$ in $A$ must lie on the boundary of A. On the other hand it lies on the arc connecting $v$ to $u$. So, it will suffice to find the intersection of the boundary and the arc.
The boundary of $A$ is precisely those points whose inner product with $v$ equals $\epsilon$. And we can parametrize the arc between $w$ and $u$ to be $cos(t)u + sin(t)v, t \in [0, \frac{\pi}{2}]$.
Solving the equation yields: $(cos(t)u + sin(t)v,v) = \epsilon \implies sin(t) = \epsilon$. And we have $t = arcsin(\epsilon)$. This gives the closest point to be $cos(arcsin(\epsilon))u +\epsilon v$. Alternatively $(\sqrt{1-\epsilon^{2}})u + \epsilon v$.
Note, ofcourse this is only true when the cap does not contain an entire hemisphere ($\epsilon > 0$) otherwise it's not even a geodesic convex set and the closest point is not even well defined.