Groupe o rthogonal
> restart:with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> ?crossprod
> ?dotprod
Double produit vectoriel
> a:=vector([a1,a2,a3]):b:=vector([b1,b2,b3]):c:=vector([c1,c2,c3]):
> crossprod(a,crossprod(b,c));
> evalm(dotprod(a,c,orthogonal)*b-dotprod(a,b,orthogonal)*c);
> evalm(%-%%);
> simplify(%);
Analyse d'une matrice de rotation
> restart:with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> A:=<<2 | 1 | 2> , <-2 | 2 | 1> , <-1 | -2 | 2>>/3;
> evalm(transpose(A)&*A);
> det(A);
A est donc dans SO3(R).
Pour générer une matrice identité sous Maple 7, on peut utiliser Matrix(n,shape=identity)
> kernel(A-Matrix(3,shape=identity));
> v:=op(%):
> arccos((trace(A)-1)/2);
> w:=vector([1,1,0]):dotprod(A&*w,crossprod(v,w));
Si on oriente Rv par v, l'angle de la rotation est alors -Pi/3. Si on oriente par -v, l'angle sera Pi/3...
>
analyse_rotation:=proc(A)
local v0,theta,w:
v0:=op(kernel(A-Matrix(3,shape=identity))):
theta:=arccos((trace(A)-1)/2);
if v0[1]=0 then w:=vector([1,0,0]) else w:=vector([v0[2],-v0[1],0]) fi:
if evalf(dotprod(A&*w,crossprod(v0,w)))>0 then RETURN(evalm(v0),theta) else RETURN(evalm(-v0),theta) fi
end;
Cette procédure ne marchera que pour de "vraies" rotations...
> analyse_rotation(A);
Construction d'une matrice de rotation
> restart:with(linalg):
Warning, the protected names norm and trace have been redefined and unprotected
> v:=vector([x,y,z]):theta:=2*Pi/3:v0:=vector([1,1,1]):
> evalm(dotprod(v,v0,orthogonal)/3*v0+cos(theta)*(v-dotprod(v,v0,orthogonal)/3*v0)+sin(theta)*crossprod(v0,v)/sqrt(3));
> genmatrix(convert(%,list),[x,y,z]);
>
generateur_exo:=proc(v0,theta)
local v,nv0,x,y,z;
v:=vector([x,y,z]):nv0:=sqrt(dotprod(v0,v0,orthogonal)): RETURN(genmatrix(convert(evalm(dotprod(v,v0,orthogonal)/nv0^2*v0+cos(theta)*(v-dotprod(v,v0,orthogonal)/nv0^2*v0)+sin(theta)*crossprod(v0,v)/nv0),list),[x,y,z]))
end:
> generateur_exo(vector([1,-1,1]),-Pi/3);
Ca marche...
> analyse_rotation(matrix([[0, 0, 1], [1, 0, 0], [0, 1, 0]]));
> analyse_rotation(generateur_exo(vector([-45,17,130]),Pi/19));
Trop fort...