Great-circle distance (source code)

= Great-circle distance
{title2=$d(u,v)=R\arccos(u\cdot v)$}

= Spherical distance
{synonym}

For points on a <sphere> of radius $R$, write their position <vectors> relative to the centre as $Ru,Rv$ with $u,v$ <unit vectors>. The <great-circle distance> is the shorter <great circle> arc length, $R$ times its central angle. Hence it equals $R\arccos(u\cdot v)$, including zero for identical points and $\pi R$ for antipodal points. At antipodal points the shortest arc is not unique, but its length is.