bonjour,
comment passe-t-om d'une representation de rotation avec angles d'euler à une representation avec axe et angle de rotation?
merci
-----
bonjour,
comment passe-t-om d'une representation de rotation avec angles d'euler à une representation avec axe et angle de rotation?
merci
"Engineering is the art of making what you want from what you get"
salut
je pense que ici c'est suffisament bien expliqué:
wikipedia/Conversion_between_quaternions _and_Euler_angles
ça ne correspond pas à ma question.
les transformation vers les quaternions je connais. je cherche la transfomation angles d'euler/ axe-angle d'euler
"Engineering is the art of making what you want from what you get"
ha pardon,
c'est juste une propostion:
tu calcules la matrice 3x3 en faisant
Rz * Ry * Rx
et ensuite tu trouves son vecteur propre avec valeur propre = 1 ce qui te donne
l'axe, et enfin l'angle tu le trouves en prenant 2 vecteurs orthogonaux entre eux et à l'axe, puis en faisant tourner l'un des 2 avec une muliplication par la matrice
ou bien sinon tu utilises (mais c'est moins drôle) le fait que la trace de la matrice = 1 + 2cos(phi)
(http://fr.wikipedia.org/wiki/Rotatio...ions_et_angles)
Dernière modification par acx01b ; 21/02/2009 à 19h49.
Et Dieu, dans sa colère, pour punir les humains, envoya sur la Terre les mathématiciens.
bonsoir,
merci pour vos reponses.
Raaah!
mes resultats ne sont pas coherents masi je ne vois pas l'erreur:
je fais les transformations
- angles d'euler vers axe-angle d'euler =>axe-angle d'euler vers quaternion =>quaternion vers matrice de rotation
- angles d'euler vers matrice de rotation
ces 3 chemains devraient avoir le meme resultat mais ce n'est pas le cas et je ne vois pas l'erreur (jai fais la simu avec les angles (pi/2,pi/6,pi/4):
- angles d'euler vers axe-angle d'euler =>axe-angle d'euler vers matrice de rotatio
euler vers axe-angle
Cliquez pour afficherfunction [vect,deg]=euler2v_angle(eul)
theta=eul(1);
phy=eul(2);
psy=eul(3);
a=cos(phy)*cos(psy);
b=-sin(psy)*cos(theta)+cos(psy)*s in(phy)*sin(theta);
c=sin(psy)*sin(theta)+cos(thet a)*sin(phy)*cos(psy);
d=cos(phy)*sin(psy);
e=cos(psy)*cos(theta)+sin(thet a)*sin(phy)*sin(psy);
f=cos(psy)*(-sin(theta))+sin(theta)*sin(phy )*sin(psy);
g=-sin(phy);
h=cos(phy)*sin(theta);
i=cos(phy)*cos(theta);
rad=acos((a+e+i-1)/2);
e1=(h-f)/(2*sin(rad));
e2=(c-g)/(2*sin(rad));
e3=(d-b)/(2*sin(rad));
vect=[e1;e2;e3];
deg=rad*180/pi;
end
axe-angle d'euler vers quaternion:
Cliquez pour afficherfunction quat=v_angle2quaternion(vect,d eg)
quat=zeros(4,1);
rad=deg*pi/180;
quat(1)=vect(1)*sin(rad/2);
quat(2)=vect(2)*sin(rad/2);
quat(3)=vect(3)*sin(rad/2);
quat(4)=cos(rad/2);
end
quaternion vers matrice de rotation:
Cliquez pour afficherfunction mr=quaternion2mr(quat)
mr=zeros(3,3);
x=quat(1);
y=quat(2);
z=quat(3);
w=quat(4);
xx=x*x;
xy=x*y;
xz=x*z;
xw=x*w;
yy=y*y;
yz=y*z;
yw=y*w;
zz=z*z;
zw=z*w;
mr(1,1)=1-2*(yy+zz);
mr(1,2)=2*(xy-zw);
mr(1,3)=2*(xz+yw);
mr(2,1)=2*(xy+zw);
mr(2,2)=1-2*(xx+zz);
mr(2,3)=2*(yz-xw);
mr(3,1)=2*(xz-yw);
mr(3,2)=2*(yz+xw);
mr(3,3)=1-2*(xx+yy);
end
angles d'euler vers matrice de rotation:
Cliquez pour afficherfunction mr=euler2mr(eul)
mr=zeros(3,3);
theta=eul(1);
phy=eul(2);
psy=eul(3);
a=cos(phy)*cos(psy);
b=-sin(psy)*cos(theta)+cos(psy)*s in(phy)*sin(theta);
c=sin(psy)*sin(theta)+cos(thet a)*sin(phy)*cos(psy);
d=cos(phy)*sin(psy);
e=cos(psy)*cos(theta)+sin(thet a)*sin(phy)*sin(psy);
f=cos(psy)*(-sin(theta))+sin(theta)*sin(phy )*sin(psy);
g=-sin(phy);
h=cos(phy)*sin(theta);
i=cos(phy)*cos(theta);
mr=[a b c; d e f; g h i];
end
axe-angle d'euler vers matrice de rotatio:
Cliquez pour afficherfunction mr=v_angle2mr(vect,deg)
rad=deg*pi/180;
mr=eye(3)*cos(rad)+(1-cos(rad))*vect*vect'-[0 -vect(3) vect(2);vect(3) 0 -vect(1);-vect(2) vect(1) 0]*sin(rad);
end
"Engineering is the art of making what you want from what you get"
je suis quasiment sur des transformation axe/angle=>quaternion et quaternion=>MR
merci
"Engineering is the art of making what you want from what you get"
j'ai resolu le pb.
le pb residait dans le fait que la norme que j'utilisais pour les angles d'euler n'etait pas la definition dans les differents codes.
merci
"Engineering is the art of making what you want from what you get"