MathGroup Archive 2009

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

Search the Archive

simplifying RotationMatrix


If I calculate the rotation matrix from one vector to another in spherical  
coordinates, the result is HUGELY complicated:

Needs["VectorAnalysis`"]

SetCoordinates[Spherical];
mean = {1, t0, p0};
pt = {1, t, p};
xy = CoordinatesToCartesian /@ {mean, pt};
rot = RotationMatrix@xy;
LeafCount@rot

32798

I don't know what to tell Simplify about this, but it seem there are MANY  
unnecessary Conjugate mentions:

Cases[rot, Conjugate[z_], Infinity] // Length

1575

and MANY unnecessary cases like this, too:

Cases[rot, Power[Abs[z_], 2], Infinity] // Length

1980

Each of these could be simply z^2, I think.

Trying to eliminate these with rules doesn't seem to help much, if any.

The first thing I thought of was PowerExpand, but

Map[PowerExpand, rot, {2}] // LeafCount

32798

What am I missing? How can it be that complicated in the first place?

Bobby


  • Prev by Date: Re: Printing (v7)
  • Next by Date: Shortest Path Problem
  • Previous by thread: Re: Re: Dynamic changing of variables
  • Next by thread: Re: simplifying RotationMatrix