Re: Normal Disappear Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg55336] Re: Normal Disappear Problem
- From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
- Date: Sat, 19 Mar 2005 04:46:22 -0500 (EST)
- References: <d1ecv2$evi$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
You need to make sure your normal is scaled so that it has unit length. {x,y,z}={Cos[u]Sin[v],Sin[u]Sin[v],Cos[v]}; norm=Cross[D[{x,y,z},u],D[{x,y,z},v]]//Simplify {(-Cos[u])*Sin[v]^2, (-Sin[u])*Sin[v]^2, (-Cos[v])*Sin[v]} normlength=Sqrt[Apply[Plus,norm^2]//Simplify]//PowerExpand Sin[v] norm/normlength {(-Cos[u])*Sin[v], (-Sin[u])*Sin[v], -Cos[v]} Steve Luttrell <gouqizi.lvcha at gmail.com> wrote in message news:d1ecv2$evi$1 at smc.vnet.net... > Hi, All: > > I have the following parametric equation for an unit sphere: > > x = cos(u)sin(v) > y = sin(u)sin(v) > z = cos(v) > > 0<=u<2*Pi ; 0<=v<=Pi > > Then I use > > normal = (Dx/Du, Dy/Du, Dz/Du) CROSS (Dx/Dv, Dy/Dv, Dz/Dv) to get the > normal vector. > > I get the follwoing after calculation (with normalization): > > normal = [sin(v) ^2 cos(u), sin(v)^2 sin(u), cos(u)^2 cos(v) sin(v) > + sin(u)^2 cos(v) sin(v)] > > Now when u=0, v=0 , Normal = (0,0,0)! How can it be? We know the fact > that a sphere should have normal everywhere. > > Rick >