A idea efficiency computational the problem solve the normals of surface in point $ P = (x_i,y_i,z_i) $. My thought to solution in way will be compute tangent plane to surface by partial derivative and gradients vector that generate the plane, being $ \vec{u}$ and $\vec{v}$ with inner product $\vec{u} \times \vec{v}$.
What other ways possible?


  • $\begingroup$ How is the surface given? As a parameterization or as an equation? $\endgroup$ – Arthur Sep 8 '15 at 15:06
  • $\begingroup$ A form equation $f(x,y)=z$ $\endgroup$ – Peter Hausdorff Smith K. Sep 8 '15 at 15:11
  • $\begingroup$ If I write the equation, if possible, in parametric form I spend less steps to calculates it? One of my doubts. $\endgroup$ – Peter Hausdorff Smith K. Sep 8 '15 at 15:14
  • 2
    $\begingroup$ If your surface is given by $\sin x+y=z$, then you rewrite it to the equation $\sin x+y-z=0$. A normal vector in any point is given by the gradient of the lefthand side at that point. $\endgroup$ – Arthur Sep 8 '15 at 16:04
  • 1
    $\begingroup$ @Arthur: you should craft that into an Answer. $\endgroup$ – hardmath Sep 8 '15 at 17:09

For a surface that is given by an equation, the simplest way to get a normal vector is by taking gradients.

For instance, you could have the graph of a function, which would have the equation $z = f(x, y)$. That can be rearranged into $f(x, y) - z = 0$, and here we can take the gradient of the lefthand side. That gives the vector $$ \nabla (f(x, y) - z) = \left(\frac{\partial f}{\partial x}(x, y), \frac{\partial f}{\partial y}(x, y), -1\right) $$ which, if you insert an $x$ and $y$ value gives you the normal vector for the surface at that point.

Another example, where your surface is not the graph of a function (at least not a priori) would be the sphere $x^2 + y^2 + z^2 -1 = 0$. We take the gradient, and get $(2x, 2y, 2z)$. If you insert the $x, y$ and $z$ values of a point on the sphere into that vector, it gives you a normal vector at that point.

Now, if your surface (named $\sigma$, say) is given by a parametrization, it usually looks either like this: $$ \sigma :\cases{x(u, v)= \ldots\\y(u, v)= \ldots\\z(u, v)= \ldots} $$ or like this: $$ \sigma(u, v) = (x(u, v), y(u, v), z(u, v)) $$ For instance, you can parametrize the sphere by $$ \sigma(u, v) = (\sin v\cos u, \sin v\sin u, \cos v) \qquad 0\leq u \leq 2\pi, 0 \leq v \leq \pi $$ In this case, to get the normal vector at a point $p$ (given by $u = u_0, v = v_0$), you do it by vector cross product. The two vectors $\vec u, \vec v$ you cross are (almost always) given by $$ \vec u = \frac{\partial \sigma}{\partial u}(u_0, v_0),\quad \vec v = \frac{\partial \sigma}{\partial v}(u_0, v_0) $$ In the case of the sphere, this gives us $$ \vec u = (-\sin v_0\sin u_0, \sin v_0 \cos u_0, 0),\quad\vec v = (\cos v_0\cos u_0, \cos v_0 \sin u_0, -\sin u_0) $$ which works nicely, except for the north and south poles, where $\vec u$ turns out to be $0$ (since $v_0$ is $0$ for the north pole and $\pi$ for the south), and $\vec v$ has a whole spectrum of different values (since $u_0$ can be whatever you want it to be and you will still be at the respective poles). So there you need to figure out something else.

  • $\begingroup$ Good. Thanks. +1 $\endgroup$ – Peter Hausdorff Smith K. Sep 8 '15 at 18:32
  • $\begingroup$ Note that in the first case discussed, $z = f (x,y) $, the gradient of $F(x,y,z) = f(x,y) - z $ never vanishes. Thus the potential difficulty mentioned at the end of the Answer is avoided in the "one variable a smooth function of the others" setting. $\endgroup$ – hardmath Sep 8 '15 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.