# Find a vector perpendicular to a surface

How would I find the vector perpendicular to the surface $\phi(x,y,z)=0$?

My initial thoughts are to calculate grad $\phi$? But would this not just give me zero? Thanks

• If $\phi$ is differentiable it is correct to calculate $\operatorname{grad}\phi$ If it's 0 or not depends on $\phi$ of course.. – user127.0.0.1 Jan 15 '14 at 16:05

The gradient of $\phi$ would work quite nicely, as long as it's not, as you say, equal to $0$. For most calculation purposes you would need to normalize it as well, though.
Example: $\phi(x, y, z) = x^2 + y^2 + z^2 - 1$ (this gives the unit sphere). The gradient is $$(2x, 2y, 2z)$$ Of course, you would only be interested in this at the points of the unit sphere, which means that in this case the length of the gradient will always be $2$, so to normalize it, we divide by $2$ and get the normal vector $\vec n(x, y, z) = (x, y, z)$, pointing directly outwards from the origin as expected.
• @user1887919 Then, with some luck, the limit of $\frac{\operatorname{grad}\phi}{|\operatorname{grad}\phi|}$ exist at that point (possibly with a sign change from one side of the surface to another, but that's OK). If that doesn't work, I'm afraid you gust have to be clever. – Arthur Jan 16 '14 at 20:26