Re: Attiude with quaternions--
- From: JEMebius <jemebius@xxxxxxxxx>
- Date: Sat, 26 Nov 2005 23:23:52 +0100
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
.
- References:
- Attiude with quaternions
- From: Steffen Loringer
- Attiude with quaternions
- Prev by Date: Re: Defining "<" for the rationals
- Next by Date: Re: I can do your homework for you
- Previous by thread: Re: Attiude with quaternions-
- Next by thread: Re: Attiude with quaternions---
- Index(es):
Relevant Pages
|
Loading