       Wrong behavior of CrossProduct

• To: mathgroup at smc.vnet.net
• Subject: [mg7958] Wrong behavior of CrossProduct
• From: sergio at scisun.sci.ccny.cuny.edu (Sergio Rojas)
• Date: Fri, 25 Jul 1997 02:40:32 -0400
• Organization: City College Of New York - Science
• Sender: owner-wri-mathgroup at wolfram.com

```(* 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:= \$Version
Out= DEC OSF/1 Alpha 2.2 (September 9, 1994)

In:= Needs["Calculus`VectorAnalysis`"];
In:= V = {a1,a2,0};
In:= U = {0, 0, 1};

In:= CrossProduct[U,V]
Out= {-a2, a1, 0}
(* This result is correct *)
In:= CoordinateSystem
Out= Cartesian
(************ Quit and start again ************)

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 quadrant
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 *)

In:= CoordinateSystem
Out= Cylindrical

(************ Quit and start again ************)

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

```

• Prev by Date: subscripts in function definitions
• Next by Date: Help: Implicit 3D-Plot
• Previous by thread: Re: subscripts in function definitions
• Next by thread: Re: Wrong behavior of CrossProduct