  We give a complete and self-contained proof of a folklore theorem which says
that in an Alexandrov space the distance between a point $\gamma(t)$ on a
geodesic $\gamma$ and a compact set $K$ is a right-differentiable function of
$t$. Moreover, the value of this right-derivative is given by the negative
cosine of the minimal angle between the geodesic and any shortest path to the
compact set (Theorem 4.3). Our treatment serves as a general introduction to
metric geometry and relies only on the basic elements, such as comparison
triangles and upper angles.
