       RE: Re: Wrong behavior of CrossProduct

• To: mathgroup at smc.vnet.net
• Subject: [mg8018] RE: [mg7976] Re: [mg7958] Wrong behavior of CrossProduct
• From: "Richard W. Finley, M. D." <trfin at umsmed.edu>
• Date: Sat, 2 Aug 1997 22:32:29 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Hi all,

There is a problem here in confusing vector components and parameters =
that define those components.  We are used to working in orthogonal =
Cartesian systems where they are equal so it is not a problem until we =
switch to a non-Cartesian orthogonal system.  The easiest way to see =
this is with the example of cylindrical coordinates where the parameters =
are {r, phi, z} and look at the cross product of unit vectors along the =
y-axis and z-axis...their cross product obviously gives the unit vector =
along the x-axis.  This means that
U = {1, Pi/2, 0}  **the y-axis unit vector*  and
V = { 0, 0, 1}  **the z-axis unit vector*

should give U X V = { 1, 0, 0 }  **the x-axis unit vector...i.e. r = =
1, phi = 0, z = 0 *

And NOT the result { Pi/2, -1, 0 } as suggested by the explanation given =
below..{a2, -a1, 0 }

This is simply a confusion of the parameters with components of the =
vector.
Hope that helps...
RF

-----Original Message-----
From:	Sergio Rojas [SMTP:sergio at scisun.sci.ccny.cuny.edu]
Subject: [mg7976] Re: [mg7958] Wrong behavior of CrossProduct

Hello:

How Mathematica implement the Cross Product of two vectors?

As far as I know the basic definition of the Cross Product between
two vectors in ANY ORTHOGONAL coordinated system is as follows:

(a1,a2,a3)X(b1,b2,b3) = (a2*b3 - a3*b2,
a3*b1 - a1*b3,
a1*b2 - a2*b1)

In physics this is usually illustrated by taking any three
UNIT vectors (u,u,u) with the orthogonal property:

u[i].u[j] = Delta[i,j]  where Delta[i_, j_] := If[i==j, 1, 0]

uxu =  u ; uxu =  u ; uxu =  u
uxu = -u ; uxu = -u ; uxu = -u
uxu =   0   ; uxu =   0   ; uxu =   0

Then, the above result follows by expanding:

(a*u + a*u + a*u)x(b*u + b*u + b*u)

and using the orthogonal property of the unit vectors.

In my example,

a = ( 0, 0,1) ; b = (a1,a2,0)

axb = ( a2, -a1, 0 ) .

This should be true in ANY ORTHOGONAL coordinated system. However,
the meaning of each symbol need to be adjusted accordingly.

Please, let me know what I am missing if the above is not true.

Rojas

E-mail: sergio at scisun.sci.ccny.cuny.edu

On Fri, 25 Jul 1997, David Withoff wrote:

> > (* Hello fellows:
> >
> >    After playing a little bit with the Mathematica construction for =
the cross
> >    product of two vectors, implemented by the function CrossProduct =
of the
> >    package VectorAnalysis, I strongly believe that CrossProduct do =
not
> >    work properly on Mathematica ... *)
> >
> > In:= Needs["Calculus`VectorAnalysis`"];
> > In:= SetCoordinates[Cylindrical[r,phi,z]];
> > In:= V = {a1,a2,0};
> > In:= U = {0, 0, 1};
> > In:= CrossProduct[U,V]
> >
> >                 2        2     2        2
> > Out= {Sqrt[a1  Cos[a2]  + a1  Sin[a2] ],
> >
> > >    ArcTan[-(a1 Sin[a2]), a1 Cos[a2]], 0}
> >
> > In:= PowerExpand[Simplify[%]]
> > Out= {a1, ArcTan[-(a1 Sin[a2]), a1 Cos[a2]], 0}
> >
> > In:= ?ArcTan
> > ArcTan[z] gives the inverse tangent of z. ArcTan[x, y] gives the =
inverse
> >    tangent of y/x where x and y are real, taking into account which =
> >    the point (x, y) is in.
> >
> >
> > 	(* Using Mathematica definition for ArcTan[x, y], Out can be
> >            rewritten as {a1,-ArcTan[Cot[a2]],0}. This answer is =
obviously
> >            wrong as far as the Cross Product of V and U concern *)
>
> I think that the result from CrossProduct[U,V] is correct.
> ArcTan[-(a1 Sin[a2]), a1 Cos[a2]] is not equivalent to =
-ArcTan[Cot[a2]].
> One way to see that is to insert numerical values for a1 and a2 and
> observe that the results are not the same.
>
> In:= ArcTan[-(a1 Sin[a2]), a1 Cos[a2]] /. {a1 -> 1, a2 -> 1.3}
>
> Out= 2.8708
>
> In:= -ArcTan[Cot[a2]] /. {a1 -> 1, a2 -> 1.3}
>
> Out= -0.270796
>
> In this example:
>
> > In:= Needs["Calculus`VectorAnalysis`"];
> > In:= SetCoordinates[Spherical[r,theta,phi]];
> > In:= V = {a1,a2,0};
> > In:= U = {0, 0, 1};
> > In:=  CrossProduct[U,V]
> > Out= {0, 0, 0}
> > 	         (* Again, wrong result. Same results were obtained on *)
> > In:= \$Version
> > Out= SPARC 2.2 (December 15, 1993)
> >
> > Rojas
> >
> > E-mail: sergio at scisun.sci.ccny.cuny.edu
>
> U is a zero vector (r is 0), so it seems that the result {0, 0, 0} for
> CrossProduct[U,V] is correct.
>
> Dave Withoff
> Wolfram Research
>

```

• Prev by Date: Mathematica 3.0 and LaTeX document preparation
• Next by Date: Animated Mathematical Physics
• Previous by thread: Re: Re: Wrong behavior of CrossProduct
• Next by thread: Re: Re: Re: Wrong behavior of CrossProduct