Solution (source code)

= Solution

Write the fixed point as $\mathbf a=(a_1,a_2,a_3)$ and the variable point as $\mathbf r=(x_1,x_2,x_3)$. Then $\mathbf R=\mathbf r-\mathbf a$ and
$$
R=\left[\sum_{j=1}^3(x_j-a_j)^2\right]^{1/2}.
$$
Since the fixed point is not on the surface, $R>0$ at every point being considered. Componentwise differentiation gives $\partial R/\partial x_j=(x_j-a_j)/R$, hence
$$
\boxed{\nabla R=\frac{\mathbf R}{R},\qquad|\nabla R|=1}.
$$
Thus the <gradient> points from the fixed point towards the variable point and is a <unit vector>. Keeping the fixed point fixed is important: differentiating a distance between two simultaneously moving points would include both endpoint derivatives.