$\DeclareMathOperator{\arccosh}{arccosh} \DeclareMathOperator*{\argmin}{arg\,min} \DeclareMathOperator{\Exp}{Exp} \newcommand{\geo}{\gamma_{\overset{\frown}{#1,#2}}} \newcommand{\geoS}{\gamma} \newcommand{\geoD}{\gamma_} \newcommand{\geoL}{\gamma(#2; #1)} \newcommand{\gradM}{\nabla_{\M}} \newcommand{\gradMComp}{\nabla_{\M,#1}} \newcommand{\Grid}{\mathcal G} \DeclareMathOperator{\Log}{Log} \newcommand{\M}{\mathcal M} \newcommand{\N}{\mathcal N} \newcommand{\mat}{\mathbf{#1}} \DeclareMathOperator{\prox}{prox} \newcommand{\PT}{\mathrm{PT}_{#1\to#2}#3} \newcommand{\R}{\mathbb R} \newcommand{\SPD}{\mathcal{P}(#1)} \DeclareMathOperator{\Tr}{Tr} \newcommand{\tT}{\mathrm{T}} \newcommand{\vect}{\mathbf{#1}}$

# The distance on the sphere

The distance on the sphere $\mathbb S^1$ is defined for any $x,y\in\mathbb S^n$, $x$ as the length of a shorter arc connecting them.

where $(\cdot)_{2\pi}$ denotes the symmetric modulo operation.

### Matlab Documentation

1
2
3
4
5
6
7
8
9
% dist(a,b) computes the length of the smaller arc of a,b on S1
%   also works for arbitrary sized array a and b componentwise
%    INPUT
%        x,y    : 2 point sets on the S1 = [-pi,pi)
%
%    OUTPUT
%        d      : lengths of the shorter arcs between a and b
% ---
% Manifold-Valued Image Restoration Toolbox 1.0, R. Bergmann ~ 2013-10-25 | 2014-10-22