= Solution
Use the ambient position coordinates $\mathbf r$ and a fixed point $\mathbf a$. The distance is $R=|\mathbf r-\mathbf a|$, so $R^2=(x-a_x)^2+(y-a_y)^2+(z-a_z)^2$. Taking its <gradient> gives $2R\nabla R=2(\mathbf r-\mathbf a)$. Therefore, away from $P=A$,
$$
\boxed{\nabla R=\frac{\mathbf r-\mathbf a}{|\mathbf r-\mathbf a|}=\frac{\mathbf R}{R},\qquad |\nabla R|=1.}
$$
It points from $A$ to $P$. The gradient is taken in the surrounding space and then evaluated on the surface; the intrinsic surface gradient of restricted distance would instead be its tangential projection and need not have unit magnitude.
Back to article page