# Finding the normal vector

I've got this question:

A opaque ball in the space with center $(10,0,-1)$ with radius with $r = 1$. A ray tracing program is tracing a ray from the eye position $(0,0,10)$ with the ray direction $(1,0,-1)$.

I've figured out that the ray will strike the ball at $(10,0,0)$, but how do I find the normal vector at this intersection point?

If $C=(a,b,c)^T$ is the center of a sphere of radius $R$ and $P=(x_P,y_P,z_P)^T$ is a point on the sphere, the normal vector to the sphere in $P$ is a unitary vector parallel to the radius in $P$: $$\vec n=\frac{1}{R}(a-x_P,b-y_P,c-z_P)^T$$