Re: Surface Normal

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

```Rick,

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

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
vector.

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.

Needs["DrawGraphics`DrawingMaster`"]

Draw3DItems[
{SurfaceColor[LightSteelBlue],
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] +
{v, Pi/8, 2*Pi, Pi/8}],

SurfaceColor[PaleGreen],
EdgeForm[],
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

From: gouqizi.lvcha at gmail.com [mailto:gouqizi.lvcha at gmail.com]
To: mathgroup at smc.vnet.net

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

Rick

```

• 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