MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cross product with Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15563] Re: [mg15521] Cross product with Mathematica
  • From: BobHanlon at aol.com
  • Date: Tue, 26 Jan 1999 13:44:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 1/19/99 5:20:10 AM, smoisan at total.net writes:

>I wanted to do some calculations involving cross product over the
>weekend using Mathematica.  That's when I discovered there's no way of
>doing any cross product using this software, at least, not in the
>version we have at the univerity which is 2.2 for Solaris.  Is this
>possible in another version?
> Is there an add-on available somewhere so I can do cross product?  Any
>help would be appreciated.
>

Use the built-in function Cross

u1 = {x1, y1, z1};
u2 = {x2, y2, z2};
w = Cross[u1, u2]

{y1*z2 - y2*z1, x2*z1 - x1*z2, x1*y2 - x2*y1}

w == -Cross[u2, u1]

True

{Dot[u1, w], Dot[u2, w]} == {0, 0} // Simplify

True

Clear[i, j, k];
w == (Det[{{i,j,k}, u1, u2}] /. 
	{{i->1, j->0, k->0},
		{i->0, j->1, k->0},
		{i->0, j->0, k->1}})

True

w == (D[Det[{{i,j,k}, u1, u2}], #]& /@ {i, j, k})

True

or define your own function

xProd[{x1_, y1_, z1_}, {x2_, y2_, z2_}] := 
		{y1*z2 - y2*z1, x2*z1 - x1*z2, x1*y2 - x2*y1};


Bob Hanlon


  • Prev by Date: Re: Non linear diff eq
  • Next by Date: Re: Q: FindMinimum
  • Previous by thread: Re: Cross product with Mathematica
  • Next by thread: Re: Cross product with Mathematica