In theory, if I have a certain function I can get his normal unit vector by using the gradient of it.
$\hat{f} = \dfrac{\nabla f}{|| \nabla f ||}$
Example (correction from answer):
$ z = 2 -x -y$ $ f(x,y,z)= z + x + y -2 $ $ \nabla f(x,y,z)= \hat{i} + \hat{j} + \hat{k}$ $ \dfrac{\nabla z}{|| \nabla z ||}= \dfrac{1}{\sqrt{3}} (\hat{i} + \hat{j} + \hat{k})$
Is that correct?
what about this example: $ z = \sqrt{x^2+y^2} $ $ \nabla f(x,y,z)= \dfrac{x}{\sqrt{x^2+y^2}} \hat{i} + \dfrac{y}{\sqrt{x^2+y^2}} \hat{j} + -\hat{k}$ $ \dfrac{\nabla f}{|| \nabla f ||}= \dfrac{\dfrac{x}{\sqrt{x^2+y^2}} \hat{i} + \dfrac{y}{\sqrt{x^2+y^2}} \hat{j} + -\hat{k}}{\sqrt{ (\dfrac{x}{\sqrt{x^2+y^2}} )^2 + (\dfrac{y}{\sqrt{x^2+y^2}} )^2 + (-1)^2 }}$
$ \dfrac{\nabla f}{|| \nabla f ||}= \dfrac{\dfrac{x}{\sqrt{x^2+y^2}} \hat{i} + \dfrac{y}{\sqrt{x^2+y^2}} \hat{j} + -\hat{k}}{\sqrt{2}}$