Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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 smc.vnet.net
  • Subject: [mg55198] Re: Surface Normal
  • From: Peter Pein <petsie at arcor.de>
  • Date: Wed, 16 Mar 2005 05:36:34 -0500 (EST)
  • References: <d15s2g$9k2$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

gouqizi.lvcha at gmail.com wrote:
> 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
> 
The same way you would do with pencil & paper:

In[1]:= normVec[f_][u_,v_]:=
  Cross[Derivative[1,0][f][u,v],Derivative[0,1][f][u,v]]
In[2]:= f[u_,v_]:={5 Cos[u](Cos[v]+2),5 Sin[u](Cos[v]+2),5 Sin[v]};
In[3]:= nv = FullSimplify[normVec[f][u, v]]
Out[6]=
  {25*Cos[u]*Cos[v]*(2 + Cos[v]),
   25*Cos[v]*(2 + Cos[v])*Sin[u],
   25*(2 + Cos[v])*Sin[v]}

If you need it normalized; divide by
In[4]:= absnv = Simplify[Sqrt[#1 . #1]&[nv], v \[Element] Reals]
Out[4]= 25*(2 + Cos[v])
or insert "(#/Sqrt[#.#])&@" (without quotes) just before "Cross" in the
above definition.

Peter


  • Prev by Date: Interaction of Sum/Plus and KroneckerDelta
  • Next by Date: Re: Surface Normal
  • Previous by thread: Re: Surface Normal
  • Next by thread: Re: Re: Surface Normal