Re: Attiude with quaternions--



Supplement to my first reply to Steffen Loringer's question
=====================================


procedure EAToQuat ({i/o} var EA: EAType; {o} var q: quaternion); {PURPOSE: Converts Euler angles representation to quaternion representation} {POST: psiplusphi = psi + phi, SIndet = FALSE, psiminusphi = psi - phi, DIndet = FALSE} {Remark: NB: The computation itself refers to psi, theta, phi only} var htheta, hpsiplusphi, hpsiminusphi: real; var hpsi, coshpsi, sinhpsi, hphi, coshphi, sinhphi: real; var coshtheta, sinhtheta, coshpsiplusphi, sinhpsiplusphi, coshpsiminusphi, sinhpsiminusphi: real; begin with EA do begin psiplusphi := psi + phi; SIndet := false; psiminusphi := psi - phi; DIndet := false; htheta := theta / 2; end; {with EA} coshtheta := cos (htheta); sinhtheta := sin (htheta); case EA.EAMode of

{============== Theoretical mechanics convention ===============}
'p', 'P':
begin
with EA do
begin
hpsiplusphi := (psiplusphi) / 2;
hpsiminusphi := (psiminusphi) / 2;
coshpsiplusphi := cos (hpsiplusphi); sinhpsiplusphi := sin (hpsiplusphi);
coshpsiminusphi := cos (hpsiminusphi); sinhpsiminusphi := sin (hpsiminusphi);
end;
with q do
begin
rc := coshtheta * coshpsiplusphi;
ic := sinhtheta * coshpsiminusphi;
jc := sinhtheta * sinhpsiminusphi;
kc := coshtheta * sinhpsiplusphi;
end; {with q}
end;


 {===========  Aerospace convention ==============}
 'a', 'A':
 begin
   with EA do
   begin
     hpsi := psi / 2;
     hphi := phi / 2;
   end;
   coshpsi := cos (hpsi); sinhpsi := sin (hpsi);
   coshphi := cos (hphi); sinhphi := sin (hphi);
   with q do
   begin
     rc := coshpsi * coshtheta * coshphi + sinhpsi * sinhtheta * sinhphi;
     ic := coshpsi * coshtheta * sinhphi - sinhpsi * sinhtheta * coshphi;
     jc := coshpsi * sinhtheta * coshphi + sinhpsi * coshtheta * sinhphi;
     kc := sinhpsi * coshtheta * coshphi - coshpsi * sinhtheta * sinhphi;
   end; {with q}
 end; {EA.EAMode = 'a', 'A'}

 end; {case EA.EAMode}
end; {EAToQuat}



Steffen Loringer wrote:

Hi,

I have the following quaternions:
q1: -0.552710
q2: -0.441034
q3: -0.604951
q4:  0.366106

and the attitude with YPR
yaw:     -97.406°
pitch:      20.230°
roll:      -90.000°

but I can't figure out how to get the YPR values from the Quaternions.

Can someone explain it the easy was?

Thanks a lot
Steve

.



Relevant Pages

  • Re: Attiude with quaternions---
    ... With theta = -90 deg, i.e. nose-down, psi and phi break down, but psi+phi is still well-determined. ... var htheta, hpsiplusphi, hpsiminusphi: real; var coshpsiplusphi, sinhpsiplusphi, coshpsiminusphi, sinhpsiminusphi: real; ...
    (sci.math)
  • Re: DAE help
    ... >>>I want to simulate the behavior of a catalyst. ... >>>Omega is the source term, which is dependend on psi and Temperature. ... >> so phi and psi are in R^8 both. ...
    (sci.math.num-analysis)
  • Re: DAE help
    ... >>a,b,c,omega,psi and phi are vectors of the length 8. ... b,c and the source term omega are functions of>psi and phi. ... > over the total length of the tube, you can use radau5 ...
    (sci.math.num-analysis)
  • Re: DAE help
    ... >>I want to simulate the behavior of a catalyst. ... which is dependend on psi and Temperature. ... >>for 8 Species with a non-uniform temperature profile over z. ... > so phi and psi are in R^8 both. ...
    (sci.math.num-analysis)
  • Re: DAE help
    ... b,c and the source term omega are functions of>psi and phi. ... >Now I am writing the function and the jacobian>subroutine. ... Hi Andreas, ...
    (sci.math.num-analysis)

Loading