       Should RotationMatrix work with symbolic vectors?

• To: mathgroup at smc.vnet.net
• Subject: [mg85952] Should RotationMatrix work with symbolic vectors?
• From: Steve Gray <stevebg at roadrunner.com>
• Date: Thu, 28 Feb 2008 02:56:49 -0500 (EST)

```It works fine when the "source" and "destination" vectors are  numeric
(it gives a matrix, say rm2, such that rm2.a2 is parallel to b2):

a2 = {1, 2, 3};
b2 = {3, 5, 7};
rm2 = N[RotationMatrix[{a2, b2}]]

{{0.997846,  0.028474, 0.059102},
{-0.0301974, 0.999138, 0.028474},
{-0.0582406,-0.0301974,0.997846}}

and

Normalize[rm2.a2]              (* rm2.Normalize[a2] also works *)
{0.329293, 0.548821, 0.76835}

which is a unit vector parallel to b2. So far, great. But unless a2
and b2 have numeric values, RotationMatrix does nothing.

avec = {a2x, a2y};
bvec = {b2x, b2y};
RotationMatrix[{avec, bvec}]   (* gives *)

RotationMatrix[{{a2x, a2y}, {b2x, b2y}}]

Can't it handle symbolics like most functions?

av = {avx, avy, avz};
bv = {bvx, bvy, bvz};
Normalize[av\[Cross]bv]  (* which gives *)

{(-avz bvy + avy bvz)/Sqrt[Abs[-avy bvx + avx bvy]^2 +
Abs[avz bvx -avx bvz]^2 + Abs[-avz bvy + avy bvz]^2],

(avz bvx - avx bvz)/Sqrt[Abs[-avy bvx + avx bvy]^2 +
Abs[avz bvx - avx bvz]^2 + Abs[-avz bvy + avy bvz]^2],

(-avy bvx + avx bvy)/Sqrt[ Abs[-avy bvx + avx bvy]^2 +
Abs[avz bvx - avx bvz]^2 + Abs[-avz bvy + avy bvz]^2]}

All three vector components have the same denominator. What's a good
way to automatically show that for clarity and speed?

I'd appreciate any information.

Steve Gray

```

• Prev by Date: Re: Re: Deleting elements from a Table
• Next by Date: Re: Deleting elements from a Table
• Previous by thread: Re: Series solution for complicated function
• Next by thread: Re: Should RotationMatrix work with symbolic vectors?