# [Maxima] RodriguesRotationFormular

Mon Nov 13 12:25:44 CST 2006

```hi all

some past we discussed RodriguesRotationFormular,now maxima can do this with
various way.
In Maxima there are at least three different methods of calculating
RodriguesRotationFormular.
First, direct calc with matrixexp.(though the most straight line is to use
caley-hamilton's a.a.a=-a ,maxima did not have this methods for matrix
function,
someone shoud write this. I think hp49 may have this.) Barton's matrixexp is
rather fine,
but simplification is complicated. same as mat_function of my diag.mac.
Second,  Adjoint map on  quaternion (lie algebra theory). natural but much
higher method
for this problem. atensor is good but on calculating matrix I met some
difficulties,so
I wrote some functions using only on quaternion.(maybe they are not useful.)

Third,  Differential geometry on S2 with standard frame (kind of moving
frame)
using differential forms is always good for students,I think.
The rest of these methods may be many ,for example,spherical functions may
be used.

First,almost everything is good.thanks Barton Package(linearalgebra)
(%i23) a:matrix([0,-z,y],[z,0,-x],[-y,x,0]);
[  0   - z   y  ]
[               ]
(%o23)                         [  z    0   - x ]
[               ]
[ - y   x    0  ]

(%i24) subst([x=sin(th)*cos(ph),y=sin(th)*sin(ph),z=cos(th)],a);

[         0             - cos(th)      sin(ph) sin(th)  ]
[                                                       ]
(%o24)     [      cos(th)              0         - cos(ph) sin(th) ]
[                                                       ]
[ - sin(ph) sin(th)  cos(ph) sin(th)          0         ]

(%i25) load(linearalgebra)\$

(%i26) matrixexp(%o24,t)\$
simplification is rather complicated,as below

(%i27) trigsimp(%)\$
(%i28) rectform(expand(%))\$
(%i29) subst(['cos(ph)=x/sin(th),'sin(ph)=y/sin(th),'cos(th)=z],%)\$
(%i30) trigsimp(%)\$
(%i31) subst(['sin(th)^2=1-z^2],%);

we obtain this RodriguesRotationFormulor
[                    2                  2          ]
[ (1 - cos(t)) (1 - z ) + (cos(t) - 1) y  + cos(t) ]
Col 1 = [                                                  ]
[           sin(t) z + (1 - cos(t)) x y            ]
[                                                  ]
[           (1 - cos(t)) x z - sin(t) y            ]

[ (1 - cos(t)) x y - sin(t) z ]
[                             ]
Col 2 = [                2            ]
[  (1 - cos(t)) y  + cos(t)   ]
[                             ]
[ (1 - cos(t)) y z + sin(t) x ]

[ (1 - cos(t)) x z + sin(t) y ]
[                             ]
Col 3 = [ (1 - cos(t)) y z - sin(t) x ]
[                             ]
[                     2       ]
[  (cos(t) - 1) (1 - z ) + 1  ]

Second,using quaternion,Adjoint map,see The Seiberg-Witten Equations and
Applications
to Topology of Smooth Four-Manifolds,by Johm W.Morgan Princeton University
Press (2.1
clifford algebra)
or nice book I recommend is Clifford Algebra (A computational Tool for
Physicists)
JOHN SNYGG   so recently we always don't use Euler Angles.
(%i1) load("yogen.mac")\$
(%i2) declare([_e,_f,_g,t],scalar)\$
(%i3) declare([_a,_b,_c],scalar)\$
(%i4) x:_e*i+_f*j+_g*k\$
(%i5) y:_a*i+_b*j+_c*k\$
(%i6) expand4((cos(t)+x*sin(t)).conj4(cos(t)+x*sin(t)))\$

(%i7) load("coeflist.lisp")\$
(%i8) load("format.lisp")\$
(%i10) format(%o6,%poly('sin(t)^2,'cos(t)^2),factor);

2       2     2     2       2
(%o10)                sin (t) (_g  + _f  + _e ) + cos (t)
so norm4(x)=1 ->norm4(cos(t)+x*sin(t))=1
if R is rodrigues rotation,then R.y =
(cos(t/2)+x*sin(t/2)).y.(cos(t/2)-x*sin(t/2))
if y=x then x=R.x as blow
/*(%i29) expand4((cos(t/2)+x*sin(t/2)).x.(cos(t/2)-x*sin(t/2)))\$
(%i30) format(%,%poly('sin(t)^2,'cos(t)^2),factor);
2 t    2      2 t    2      2 t    2      2 t
(%o30) (sin (-) _g  + sin (-) _f  + sin (-) _e  + cos (-)) (_g k + _f j + _e
i)
2             2             2             2
(%i31) trigsimp(subst([_g^2=1-_f^2-_e^2],%));
(%o31)                        _g k + _f j + _e i        */
so main part is one line.
(%i11) expand4((cos(t/2)+x*sin(t/2)).y.(cos(t/2)-x*sin(t/2)))\$

but need simplification and format as such
(%i12) format(%,%poly(i,j,k),factor)\$

(%i13) coefmatrix([coeff(%,i),coeff(%,j),coeff(%,k)],[_a,_b,_c])\$
this matrix is RodriguesRotationMatrix
simplification also complicated

(%i14) trigsimp(subst([_g^2=1-_f^2-_e^2],%))\$
(%i15) trigreduce(%)\$
(%i16) format(%,%poly(_g,_f,_e),factor);
[                            2     ]
[    cos(t) - (cos(t) - 1) _e      ]
(%o16)  Col 1 = [                                  ]
[  sin(t) _g - (cos(t) - 1) _e _f  ]
[                                  ]
[ - (cos(t) - 1) _e _g - sin(t) _f ]
[ - sin(t) _g - (cos(t) - 1) _e _f ]
[                                  ]
Col 2 = [                            2     ]
[    cos(t) - (cos(t) - 1) _f      ]
[                                  ]
[  sin(t) _e - (cos(t) - 1) _f _g  ]
[     sin(t) _f - (cos(t) - 1) _e _g      ]
[                                         ]
Col 3 = [    - (cos(t) - 1) _f _g - sin(t) _e     ]
[                                         ]
[                2                  2     ]
[ (cos(t) - 1) _f  + (cos(t) - 1) _e  + 1 ]

I like this method,but need much mathematical kowledge.
to be continue
thank             Gosei Furuya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20061114/e17fb926/attachment.htm

```

More information about the Maxima mailing list