Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Surface Normal

  • To: mathgroup at
  • Subject: [mg55188] Re: [mg55167] Surface Normal
  • From: "David Park" <djmp at>
  • Date: Wed, 16 Mar 2005 05:36:05 -0500 (EST)
  • Sender: owner-wri-mathgroup at


Write the Mathematica parametrization for the surface, which is just a

surface[u_, v_] := {(10 + 5Cos[v])Cos[u], (10 + 5Cos[v])Sin[u], 5Sin[v]}

Calculate tangent vectors to the surface in the u and v directions.

uvec[u_, v_] = D[surface[u, v], u]
vvec[u_, v_] = D[surface[u, v], v]
{-(10 + 5 Cos[v]) Sin[u], Cos[u] (10 + 5 Cos[v]), 0}
{-5 Cos[u] Sin[v], -5 Sin[u] Sin[v], 5 Cos[v]}

Now take the cross product and normalize the result to obtain a unit normal

Simplify[Cross[uvec[u, v], vvec[u, v]]];
normalvec[u_, v_] = Simplify[%/Sqrt[% . %]]
{(Cos[u]*Cos[v]*(2 + Cos[v]))/Sqrt[(2 + Cos[v])^2],
  (Cos[v]*(2 + Cos[v])*Sin[u])/Sqrt[(2 + Cos[v])^2],
  ((2 + Cos[v])*Sin[v])/Sqrt[(2 + Cos[v])^2]}

That's the answer. You can get a nice plot of this using the DrawGraphics
package at my web site below.


    EdgeForm[ColorMix[LightSteelBlue, Black][0.4]],
    ParametricDraw3D[Evaluate[surface[u, v]], {u, 0, 2*Pi},
     {v, 0, 2*Pi}],

    SurfaceColor[Salmon], EdgeForm[],
    Table[Arrow3D[surface[Pi/4, v], surface[Pi/4, v] +
       5*normalvec[Pi/4, v], HeadLength3D -> 0.25],
     {v, Pi/8, 2*Pi, Pi/8}],

    Table[Arrow3D[surface[u, Pi/2],
      surface[u, Pi/2] + 5*normalvec[u, Pi/2],
      HeadLength3D -> 0.25], {u, Pi/8, 2*Pi, Pi/8}]},

   NeutralLighting[0.3, 0.5, 0.1],
   BoxStyle -> Gray,
   Background -> Linen,
   ImageSize -> 450];

This has a set of salmon tipped arrows going around the torus one way and a
set of pale green tipped arrows going around the torus the other way. The
lengths of the vectors are scaled up to give a better appearance.

David Park
djmp at

From: gouqizi.lvcha at [mailto:gouqizi.lvcha at]
To: mathgroup at

Hi, All:

If I have a surface in parametric form

For example,
x = (10 + 5cosv)cosu
y = (10 + 5cosv)sinu
z = 5sinv

How can I quickly calculate its normal for any (u,v) by mathematica


  • Prev by Date: Re: Do loops in Mathematica
  • Next by Date: Re: Do loops in Mathematica
  • Previous by thread: Re: Surface Normal
  • Next by thread: Do loops in Mathematica