Distance between two points on a sphere. Say there is a sphere on which there is an ant and the ant wants to go to another point. The ant can't definitely travel through the sphere. So it has to travel along a curve. My question is what is the least distance between the two points i.e. distance between 2 points on a sphere.

If $a = (a_{1}, a_{2}, a_{3})$ and $b = (b_{1}, b_{2}, b_{3})$ are points on a sphere of radius $r > 0$ centered at the origin of Euclidean $3$-space, the distance from $a$ to $b$ along the surface of the sphere is
$$
d(a, b) = r \arccos\left(\frac{a \cdot b}{r^{2}}\right)
  = r \arccos\left(\frac{a_{1}b_{1} + a_{2}b_{2} + a_{3}b_{3}}{r^{2}}\right).
$$
To see this, consider the plane through $a$, $b$, and the origin. If $\theta$ is the angle between the vectors $a$ and $b$, then $a \cdot b = r^{2} \cos\theta$, and the short arc joining $a$ and $b$ has length $r\theta$.
