Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Re: [Help]How to reprensent the result in vector form?

  • To: mathgroup at
  • Subject: [mg51594] Re: [mg51584] Re: [Help]How to reprensent the result in vector form?
  • From: DrBob <drbob at>
  • Date: Wed, 27 Oct 2004 01:53:53 -0400 (EDT)
  • References: <cl9t1d$7m0$> <>
  • Reply-to: drbob at
  • Sender: owner-wri-mathgroup at

This won't always work, however.

crossrule = {a3_ b2_ - a2_ b3_, a1_ b3_ - a3_ b1_,
   a2_ b1_ - a1_ b2_} -> myCross[{b1, b2, b3}, {a1, a2, a3}];

Cross[{u1, u2, u3}, {v1, v2, v3}] /. crossrule

Fine so far, but these should return cross products too:

{-u3 v2+u2 v3,u3 v1+u1 v3,-u2 v1-u1 v2}

{-u3 v2-u2 v3,u3 v1-u1 v3,u2 v1+u1 v2}

{u3 v2+u2 v3,-u3 v1-u1 v3,-u2 v1+u1 v2}

Besides this problem there are other issues, such as:

(1) EVERY vector is the cross product of two vectors,


(2) The vectors are never unique.

Good luck!!


On Sat, 23 Oct 2004 00:22:49 -0400 (EDT), Steve Luttrell <steve_usenet at> wrote:

> You can use a replacement rule to convert your expression into the compact
> form that you want:
> Define the replacement rule.
> crossrule = {a3_ b2_ -a2_ b3_,a1_ b3_ -a3_ b1_,a2_ b1_ -a1_ b2_} ->
> myCross[{b1,b2,b3},{a1,a2,a3}];
> Apply the rule to your expression.
> result = {-u3 v2 + u2 v3, u3 v1 - u1 v3, -u2 v1 + u1 v2}/.crossrule
> which gives the output
> myCross[{u1,u2,u3},{v1,v2,v3}]
> You could make the notation more compact by doing this
> result /. {{u1,u2,u3} -> u,{v1,v2,v3} -> v}
> which gives the output
> myCross[u,v]
> Another (related but more sophisticated) method is to use the
> Utilities`Notation` package to implement the reformatting of your output
> automatically. This includes a way of defining infix operators so that you
> can get an output that looks like u x v rather than myCross[u,v]
> Steve Luttrell
> "melon" <sweetmelon at> wrote in message
> news:cl9t1d$7m0$1 at
>> I used mathmetica5 to solve a vector equation. Mathmetica expands the
>> result into sub-variable form. But I want to get the vector form. How
>> to do that?
>> ex:
>> Solution:
>> {-u3 v2 + u2 v3, u3 v1 - u1 v3, -u2 v1 + u1 v2}
>> I want mathematica give me {u cross v}
>> p,s,  Could you add me into the forum? Thank you very much. Regards.
>> ShenLei

DrBob at

  • Prev by Date: Re: f'[t]== x[t]+u[t] ?
  • Next by Date: Re: Integration of UnitStep has bugs!? help!
  • Previous by thread: Re: [Help]How to reprensent the result in vector form?
  • Next by thread: Re: How to reprensent the result in vector form?