If z=S(x,y)

Recall that the gradient vector is normal to a surface at a given point. If we have z=S(x,y), define
g(x,y,z)=S(x,y)-z.

Then grad g is normal to the surface.

grad g=( D[S,x], D[S,y], -1)

Unit could also find a unit normal grad g/|| grad g ||.

Note that ( - D[S,x], - D[S,y], 1 ) is a normal vector in the opposite direction.

Note that as a special case of R(u,v), if we can write
x=u
y=v
z=S(u,v)

then we have
D[R,u]=D[R,x]=(1,0,D[S,x])
D[R,v]=D[R,y]=(0,1,D[S,y])

and

D[R,u] x D[R,v]=(- D[S,x], - D[S,y], 1)
which was one of the normals we found when z=S(x,y).


  Clear[S,f,x,y]
  S[x_,y_]:=Sqrt[4-x^2-y^2]
  f[x_,y_,z_]:=S[x,y]-z


  nv=grad3[f][x,y,z]

In the example above we used the point where u=v=Pi/4. This corresponds to the point
x=1
y=1
z=Sqrt[2].
Check:


  R[Pi/4,Pi/4]


  normalv=vectorPlot[{{1,1,Sqrt[2]}},{{1,1,Sqrt[2]}+nv/.{x->1,y->1,z->Sqrt[2]}}];

Oops! This normal vector will point inside the sphere. Let's use the opposite one.


  normalv=vectorPlot[{{1,1,Sqrt[2]}},{{1,1,Sqrt[2]}-nv/.{x->1,y->1,z->Sqrt[2]}}];


  Show[sph,normalv];


  tp=ContourPlot3D[({x,y,z}-{1,1,Sqrt[2]}).(-nv/.{x->1,y->1,z->Sqrt[2]}),
  {x,-2,2},{y,-2,2},{z,-2,2}];


  Show[sph,normalv,tp];

Another option for the normal plane would be to use the formulation
n1(x-x0)+n2(y-y0)+n3(z-z0)=0.
Then you could use z=[-n1(x-x0)-n2(y-y0)+n3z0]/n3
and then use Plot 3D


  n1=(nv/.{x->1,y->1,z->Sqrt[2]})[[1]]
  n2=(nv/.{x->1,y->1,z->Sqrt[2]})[[2]]
  n3=(nv/.{x->1,y->1,z->Sqrt[2]})[[3]]
  x0=1
  y0=1
  z0=Sqrt[2]


  tp2=Plot3D[(-n1(x-x0)-n2(y-y0)+n3 z0)/n3,{x,-2,2},{y,-2,2}];


  Show[sph,normalv,tp2];

Up to Tangent Planes