Finding the vector (direction) on surface that has the minimal temperature (given by formula) everybody!
The temprature on a mountain described by: $T(x,y,z) = x^2 + y^2 + z^2$
The mountain desribed by $z = -x^2-y^2 +5$
A man, whos coordinates are $(1,1,3)$, wants to go on a direction, in which he gets cold the quickest way. 
So, the algorithm is (correct me if i wrong):
 1. Find the gradient of T in (1,1,3) = (2,2,6).
 2. Find the gradient of the surface $f(x,y,z) = z+x^2+y^2 - 5 = 0$ in (1,1,3) = (2,2,1)
 3. Demand that the N that i found (gradient of the surface) will be perpendicular to the gradient of T, by dot product: $ (2,2,1) dot (2,2,c)$
Then the c I find, is the missing component, for the direction on the surface, so it is (2,2,c) in that example - (2,2,-4), Am I right? 
 A: Here is a method continuing your idea. 
You should use the negative of the gradient since you are looking for the direction in which the temperature decreases the fastest. Then look for the projection of that direction onto the tangent plane of the mountain. 
The gradient direction of the temperature is $\vec{t}=(-2,-2,-6)$. The normal vector of the tangent plane is the gradient of the mountain $\vec{n}=(2,2,1)$.
The projection is
$$\vec{t}-\frac{\vec{t}\cdot\vec{n}}{\vec{n}\cdot \vec{n}}\vec{n}$$
Edit: This method only works for this special case. user251257 gives a better method that works for general case. Here I just want to illustrate how to find the projection of a vector onto a plane.
The following picture shows the projection of a vector $\vec{t}$ onto a plane with normal vector $\vec{n}$:

Notice the little red vector is the part $\frac{\vec{t}\cdot\vec{n}}{\vec{n}\cdot \vec{n}}\vec{n}$. So subtraction gives you the projection onto the plane. 
A: The task is to walk away from the present location such that the temperature decreases as much as possible.
We are at $(1,1,3)$, the temperature gradient points at $(2,2,6)$.
If we move by $dx$ and $dy$ the change in position is
$$
dr = (dx, dy, z_x dx + z_y dy) = (dx, dy, -2(dx +dy))
$$
The change in temperature moving there is
$$
dT 
= (T_x, T_y, T_z) \cdot dr 
= (2,2,6) \cdot dr
= 2dx + 2dy - 12(dx + dy) = -10(dx+dy)
$$
With $x = r \cos \phi$, $y = r \sin \phi$ and only moving along the radius for fixed $\phi$ we have $dx = \cos \phi dr$ and $dy = \sin \phi dr$ and $dx + dy = (\cos \phi + \sin \phi) dr \le \sqrt{2} dr$ for $\phi = \pi/4$.
So I would run in that direction.
