DOUGLAS TECHNICAL HOUSTON...MCDOIiIIELL DOUGLAS TECHNICAL SERVICES CO.HOUSTON ASTRONAUTICS DIVISION...
Transcript of DOUGLAS TECHNICAL HOUSTON...MCDOIiIIELL DOUGLAS TECHNICAL SERVICES CO.HOUSTON ASTRONAUTICS DIVISION...
MCDOIiIIELL DOUGLAS TECHNICAL SERVICES CO. HOUSTON ASTRONAUTICS DIVISION
SPACE SHUTTLE ENGINEERING AND OPERATIONS SUPPORT
DESIGN NQTE NO. 1.4-8-020
EULER ANGLES, QUATERN IONS, A140 TRANSFORMATION MATRICES FOR SPACE SHUTTLE ANALYSIS
MISSION PLANNING, MISSION ANALYSIS, AND SOFL6I~IARE FORMULATIOIJ . .
This Design Note i s Submitted t o NASA Under Task Order D0710, Task Assignment D, Contract NAS9-14960.
. Prepared by:
Approved by:
Task Manager 488-5560, Ext. 248
' d ? Approved by: - , , F , , > ~ . ' & e / J . .
P. M:'Efugge ' Work Package Manager
488-5660, Ext. 222 vl M A & G 3 = ' C ) T;=mO) - 4 W H
Approved by: U ! (f db!* Approved by: W. E. Wedlake
%?'a/[- W. €. yltyes
In teg ra t ion Manager 488-5660, Ext. 293
WBS Manager 488-5660, Ex t . 266
https://ntrs.nasa.gov/search.jsp?R=19770019231 2020-06-08T20:34:21+00:00Z
DN N O . : 1 ,4-8-020 Page: 1
Due t o the extensjve use o f the quaternion i n the onboard Space
Shuttle Coniputer System, consf derable analysis i s being performed using
relationships betwclen the quaicrnion, the transformation matrix,
and t h e Euler angles. This Design Note offers a brief mathenlatical
development of the relationships between the Euler angles and the
transformation matrix, the quaternion and the transforma'tion
matr ix, and the Euler angTes and the quaternion. The analysis
and equations presented here apply d i rec t ly t o current Space
Shuttle problems. Appendix A presents t h e twe l ve three-axis
Euler transformation matrices as functions o f the Eul er angles, . .
the equations f o r the quaternion as a function o f t he Euler angles,
and the Euler angles as a function of the transformation matr ix
The equations o f Appendix A are a v a l u a b l ~ reference il: Shut t le
analysis work and this Design Note i s t h e o n l y known document where
each o f the twelve Euler ang le t o quaternion relationships a re
given, Appendix B presents a group o f u t i l i t y subroutines t o
accomplish the Euler-matrix, quaternion-matrix, and Eul er -
quaternion relationships o f Appendix A,
DN NO. : 1.4-8-020 Page: 2
2.0 DISCUSSIOt4
2.1 Euler Angle Transforlnation Matrices
The f o l l o w i n g analysis and util i t y subrout ines are offered
t o simp1 i f y computer programs when working w i t t l coordinate
transformation matrices and their relationships w i t h t h e
Euler Angles and the Quaternions . The coord ina te t r a n s f o r -
mation m a t r i c e s discussed .here are def ined using the f o l iowing
figure,
FIGURE 1
The t ransfornlat ion m a t r i x M , i s def ined t o transf0r.m v e c t o r s - - -
i n the ?- system (x, y , z ) i n t o t l i c . o r i g i n a 1 x-system (x , y,
2 ) and i s givcn by the equa t ion ,
x = MST
where (1 )
- - - x = (x , y, z) and 51 = (x, y, 2 ) .
Using the right-hand rule f o r p o s i t i v e r o t a t i o n s , t h e M mat r ix
i n (1 ) above i s c o n s t r u c t e d by t h e fo l l owing analysjs. The
f i r s t r o t a t i o n i n Figu re 1 above i s about the x-ax is by the
amount The s i n g l e r o t a t i o n about t h e x-ax is r e s u l t s in , I
t h e fo l lowing t r ans fo rma t ion ,
or x = X? i n ma t r ix -Form. Rota t ion about the y ' - a x i s by t h e
amount O2 y i e l d s t h e i n t e rmed ia t e transformation matr ix :
or x' = Yyb i n m a t r i x form. F i n a l l y rotation about the ?'-axis
by the amount O3 yields the in t e rmed ia t e t r ans fo rma t ion 'ma t r ix ,
DN NO. : 1.4-8-020 Page: 4
and i n n ~ a t r i x forn i = zZl. NOW using the th ree equations,
by substitution
x = ( X Y z) x. Then frorn equation 1,
M = ( X Y Z)
Computation f o r the M m a t r i x f r o m the indicated matrix multi-'
p l i c a t i o n i n equa t ion (7) yields,
(- C O S O ~ sine3) ( ~ i n 8 ~ )
sinsl sinee cose3) (case, cose3 - sine, sine2 sineg)(- pine, 3 3 ~ 9 ~ ) (S l - cosel sine2 c 0 s 8 ~ ) ( s i n 0 ~ coseg + cosel sine2 ~ i n e ~ ) ( c o s 8 ~ cvse2)
The m a t r i x M in equation (8) i s a function of;
(1 ) The three Euler angles el O2 and e3 and
(2) The sequence o f rotations used t o generate the 'matr ix .
By examination of equation ( 7 ) i t i s possible t o show t h a t t he re
are twe lve possible Euler rotat ional . sequences. If the . ( X Y I )
notation i n equation (7) represents a ro ta t ion abou t the X axis,
then the Y a x i s and f i n a l l y t h e Z a x i s , then t he following per-
Df4 NO. : 1.4-0--020- Page: 5 . ,'
niutations o' t h e r o t a t i o n a l o r d e r represents t he twel ve possi t l o
Eu7 er angle s e t s using three r o t a t i o n s ,
X Y Z Y X Z Z X Y
X Z Y Y Z X Z Y X
X Y X Y X Y Z X Z
x z x Y Z Y
Any repeated a x i s r o t a t i o n such as XXY does not represent a
t h ree a x i s rota t ion b u t reduces t o t h e two axis rotation XY. .
Hence the rotations described i n (9) above represent a17
twe] ve poss ib l e sets o f Euler angle defini.ng sequences. Con-
versely then , f o r a given transformation matr ix there are
twe l ve Euter angle sets which can be extracted from the matrix.
The 'Eul er matrices corresponding t o a1 1 possible rota t ional
sequences o f ( 9 ) above are presented i n Appendix A.
The util i t y sub rou t ines "EULHAT" generates t h e trans'formation
matr ix from a given Eufer sequence and the Evler angles . The
util i ty subroutine "EIIATEUL" extracts the Euler angles from a give^
Euler rotational sequence. The convention i s es tab l ished t h a t
the Euler angles occur i n the same sequences as the a x i s
rota t ions . U s i ~ ~ g this coccept and functional n o t a t i o n , equat ion (7)
could be expressed as
M = X Y Z = M(BX, Qy, ElZ)
and from (9 )
Dl4 Na. : 7.4-8-020 Page: 6
M = X Z X = M ( o , , o,, 8;) e t c . (11 1
This convention i s assurncd i n both subroutines and a l s o
used t h r o u g h o u t this design note when Euler angles are
used. A brief expfainatjon of the use of these two
u t i l i t y subroutines i s gjven i n Appendix B.
I t i s interest ing t o note tha t a negative rotation in
t h e s ingle a x i s rotation matrices of equations (21 , ( 3 )
and ( 4 ) will r e su l t in the formation of the transpose
o f the matrix. However the transpose o f M in equation
(7) i s f o r m ~ d from reversing the order o f multiplication
' ,and transposing the ind iv id~ ,1 a x i s rota t ion equations,
i .e.
Hence the transposes of the matrices o f (9) are eas i ly
formed by reversing the order o f mu1 t i p7 ication and
transposing each s ingle axis rotation equation.' Using
the notation i n equations(l0) and (11 ) above equation
(12) could be nr i tten, -
I t i s recornended t o avoid confusion t h a t the 'forward
transformation be conputed and simply transposed t o yield
the reverse transforrnation m a t r i x . All matrices of Appendix
A are i n t h e forward form, i , e . X blx and formed from (9).
DN NO. : I . 4-8-020 Page: 7
2.2 TRAPISFORI-IATIOtI I4ATRICES USING THE tIAI.11 I-TON QUAl'EREIIOfI
The transformation mat r i x o f equat ion (1) can be wri t ten as
a function o f the Hamil ton Quaternion ;
q2 = cos a s i n w/2
93 = cos Psin u/2
q4 = cos y s i n w / 2 , where o is the rota t ion an i l e about t h e rota t ion axis w i t h
a, 8 . and y d i r e ~ t i & ' a < ~ l e s with the x, and z axes re- 2 2 2 . 2 - spebtively:. Notice a l so t h a t ql -I- qp + q3 + q4 = 1, s ince
2 2 2 cos u + cos p+ cos y 1 . The rotatiori angle, w, i s assumed
p o s i t i v e according to the r ight-hand ru l e o f axis ro ta t ion . . .
The mat r i x M becomes
For a more detailed discussion. of the derivation of equation
(16), see Reference 1 , Using functional notation, equation
(15) can be written,
M = M h l . q2. q3. q4). (76)
Ulll i ke the Eul er angle rota t ional sequences to describe the
transformation matrix o f equat ion (1 ), only two quaternions
can be . . found from equat ion (15). The two 'quaternions are:
DN NO. ; 1 ,4-8-020 Page: 8
and 93 -93
These two quaternions represent a po.si t i v e r o t a t i o n abou t
the r o t a t i o n a x i s po in t ing i n one d i r e c t i o n and a p o s i t i v e
r o t a t i o n about the same line o f r o t a t i o n po in t ing i n the
opposiPe direct lon. Both quatern ions o f (17) s a t i s f y equa t ion
(15).
The, u t i l i:ty s u b r o u t i n e "QMAT1' generates t h e t r ans fo rma t ion
matrix from a given quatern ion. The ''91t4Tfl a lgo r i t hm gene ra t e s
the matrix as given i n equation (15) w i t h o u t dup l i ca t i ng any
a r i t h m e t i c operat ions. The subroutine "MATQ" e x t r a c t s the p o s i t i v e
quaternion, i .e., q, > 0, from the t ranzformat ion m a t r i x and
normal izes the r e s u l t s t o guaran tee an orthogonal matr ix . In
order t o avo id any d i scon t i nu i t y i n ex t rac t i ng t h e quaternion
from t h e t r ans fo rma t i on matr ix, the procedure as described i n
Reference 2 i s used.
E a r l y works by Hamil ton (Reference 3) presented t h e qua te rn ion
as having a sca la r and a vector p a r t , i.e.,
and equation (76) c o u l d be expressed as, -b
. M = Nql, q 2 9 q3, q4 ) = M(5, V ) .
DU NO. : 1.4-8-020 Page : 9
For a given quntcr t i ion the fo l l owing r e l a t i o n s h i p i s
true (from (17) above), -t -C
M(S, V ) = l. l(-S, 4) . (20)
The transpose o f t he t rans format ion m a t r i x is given by,
2.3 EULER ANGLE AND QUATERNION RELATIONSHIPS.
By examination o f equat ions !lo) 2nd (16) the equality,
can. be erritten. Based on an equality for ,each element o f the
m a t r i x t h e following nine equations murt be t rue ;
sinel C O S ~ ~ +- cosel sine2 s in8 3 = Z(q3q4 + q1q2)
I t i s p o s s i b l e to solve for the values o f the quatern ion using
the t r i gonomet r i c h a l f angle i d e n t i t i e s . For t h i s Euler sequence,
i .e. X(el ) Y (e2) Z (ej), the f o l l o w i n g quaternion resul ts ;
DN NO. : 1 ,4-8-020 Page: 10
Appendix A gives the quatern ion as a function o f t h e Euler
angles for each of t h c tvrelve Euler r o t a t i o n a l sequence pre-
sented in Section 2.1. The special equat ions for t h e qua te rn ion
s func t ions zr" the Euler angles, 1 i ke equat ions (24) above,
are sometimes cumbersome to use, especially when multiple
~ u l e r sequences are utilized. Less coding, ' bu t perhaps more . . computer apera t ions , a r e r equ i r ed by using the more general
method of f i r s t gene ra t ing the mat r ix M fronl thz given Euler
angle set and then simply extracting the quatern ion from the
matrix. This method i s e f f e c t e d by f j r s t a cal l t o ,"EULt44T"
and then a c a l l t o "MASQ"..
ON NO.: 1.4-8-020 Page: 11
3.0 REFEI1T;lICES -we-.--
1. Working Paper: MDTSCO, TI1 No, 1.4-MPB-304, E914-8A/B-003,
"Quaternions and Quaternion Transformations ,I1 Dav id M.
tlcnderson, 23 June 1976,
2. Transmi t t a l i4cmo: MDTSCO, "I .4-MPB-229, "Irnprovi ng Con~pu ter Accuracy
i n Ex t rac t ing Quaternions," Dav id M. Henderson, 9 March 7976.
3. Sir W i l l i a n ~ Rowan Hamilton, LLD, LL,D. MRIA, D.C.L. CANTAB.,
"Eiements of Q u a t ~ r n i o n s " 2 Vo1 m e s , Chelsea Put1 i s h i n g Company,
New York, N. Y., 3rd Edi t i on 1 969, L ibrary o f Congress 68-5471 1
ON NO. : 1,4-8-020 Page: 12
APPENDIX A
The twelve Euler matrices for each ro ta t ion sequence are gSven based.
on t he s i n g l e a ~ i s rotation equations ( 2 ) , ( 3 ) and (4). The Euler
m a t r i c e s transform vectors from the system t h a t has been ro ta ted i n to
vectors i n the s ta t ionary system. Also presented here are the equaticns
f o r t h e quatern ion as a function o r t h e Euler angles and the*Euler
angles as a funct ion o f the matrix elements for each rotation sequence.
DN NO. : 1 -4-8-020 Page: 13
A x i s Rota t ion Scquecre: 1, 2, 3
-1 "13 O2 = t a n ( 2)
'-ml 3
Dt-i NO. : 1.4-8-020 Page: 14
Ax is Rota t lon Sequence: I , 3 , 2
DN No. : 1 -4-8-020 Pagc: 15
Ax i s R o t a t i on Sequence: 1, 2, 1
e2 = tan -1 (F)
DN NO, : 1 .4-0-020 Page : 16
(4 ) El = M ( X ( e l ) , z(e2) . X ( 9 ) = XZX
Axis Rota t i on Sequence : 1, 3 , 1
B2 = t an - 1 ( V ) "1 1
Axis Rotat ion Sequence: 2, 1 , 3
Axis Rotat ion Sequence: 2, 3, 1
- C O S O ~ C O S ~ ~ - C O S B ~ ~ ~ ~ ~ ~ C O S D ~
+ ~ i n 0 ~ s i n O ~
sine2 C O S O ~ C O S ~ ~
-sinOl cose2 sine, s i ne2cosf3, -sine, sin02sin03
+cosol sin€$ -
@1 = tan-' ( z)
DN NO. : 1.4-8-020 Page: 20
Axis Rotation Sequence: 2, 3, 2
Axis Rotation Sequence: 3, 1 , 2
O3 = t a n -1
DN 110. : 1 -4-0-020 Page: 22
Axis Rotation Sequence: 3 , 2 , 1
A x i s Rota t ion Sequence: 3, 1 , 3
DN NO. : 1.4-8-020 Page: 24
A x i s Rotation Sequence: 3, 2, 3
€I2 = tan -1 (J- )
Thc f o l l o w i n g subrou t ines w i t h a b r i e f description oc t h e i r use are
presented i n t h i s appendix.
(1) "EULMAT" - Generates the transformation m a t r i x from a given s e t of
Euler angles and an a x i s rotation sequence.
( 2 ) "MATEUL" - Extracts the Euler angles from the given transformation
matrix and an a x i s rotation sequence.
( 3 ) "QMAT1' - Generates the t ransformat ion ,natnix fron~ a g iven
quaterni on.
(4) l ' ~ ~ f b l t - Extracts t h e quaternion from a given transformation
matrix.
(5) "YPRQ" - Generates t he quatern ion di rec t ly from t h e yaw-pitch-
roll Euler angles.
( 6 ) '"POSNOR" - Computes t h e posi t ive-normal i zed quaternion fram the
given quaternion.
INPUT:
DN NO, : 1.4-8-020 Page: 26
EULMAT
Generates a 3 x 3 transfor~nation matrix from a
given sequence and Euler angle s e t ,
ISEQ - Ro ta t i on Sequence (Integer Array ( 3 ) ; i . e . ,
1 , 2, 3 )
EUL - Euler Angles in radians, i n "ISEQ"
Order ; ARRAY ( 3 )
OUTPC T : A - he 3 x 3 transformation matrix
ALGORlTHM REFEREWE: Appendi .~ A; Eul er Sequences (1 ) thru (12),
DN NO.: 1.4-8-020 Page: 27
EULER AlIGLES TO TI1E TRt\llSFOR'lATION MATRIX .
--11.1.---.---..*---- - -I.C-I.l".f.-.--l-l - . * . I . I C - ---..--. --I .-.----I.- -.. -.----__...- ..-. ----.. --.--- -.. s u j r t o ~ l ~ l r ! t LUL'IAT C N T R Y POI K T p~ir237
. .. . STGxALE , lSSIGF.~MENT t 2 t O C k , , T Y P E , V E t h T 1 V C L C C ~ T I D E S , lr ir l4C) . . " .
- - - 7 - - t 'Vl7. , : - . . (r- A *.a- -.- .--- -'
L ~ G J ? ~ . - ; - 78; IT IL.ET; .J 1 ~!cL[:'=x(K,J,;I-------'.' . 3.;; - 3F C L . i ( , . i 1 H O l . i . = , i I l : , J 1 - . y j ~ 7 9 ?+ If [ i ~ ~ 1 ! - I i r L i l ) . I - T m l . . . : L - l ,.I 60 T O 253 -a. 'L.Y. IF.(-t?F.5) 7 l;.,.I\ v - : ' ) . ] - : 1.T * 1 T 0 25-2
i 1s ~ € I ~ T I ' = T L . ~ P + X ( I r K t I - : l f : t I l i L ~ t 2+ 2 5 i C C Y T I :rUE 1 zg: l , F ( t . T - u , i ! i l ( ? , J f = T k - r Y P -
-.u ---_c! ;I +p T F ( L-m*~.&..* 1 , J l=J r PIP $ =.$
*- XPIZ 3 2 2 . CD:;TI XU:
EtJD DF C O K P J L A T I O l 4 : -.-
NO. .ET C\Gh!USTlCS. *.-
NAME: - PURPOSE:
INPUT :
MATEUL
Ex t rac ts t h e Euler angles f rom t h e g iven t rans -
formation m a t r i x and t h e r equ i r ed Eulcr
r o t a t i o n a l sequence.
I S E Q - R o t a t i o n sequence, (Integer Array ( 3 ) ,
A - The 3 x 3 transformztion'
OUTPUT: EUL - The Euler angles, in " ISEQ" ordcr;ARRAY(3).
ALGORITHM REFEREPIC€: Appendix A; Euler angles as a function o f the
m a t r i x elements, sequences (1 ) thru (12 ) .
TRANSFORf4ATIOlI -- IIATRIX TO THE LULER ANGLES -
STni;ftGf E55TENE!EP!T IFLOCK, T Y P E , R E L A T I V C L O C A T I O P . : , i (PFtE 1 . ..
- - r s i ?;.?L':! L 2 1 "3l27 r ; j O R 33Rl;l f 'jt!7.-ttrc3 L3Ll 1 '3L335
DN No. : 1.4-0-020 Page: 31
.- . -- - T TRANSFORlllATION WATIZI X TO THE EULER ANGLES - ( C O N T I ~ ~ I I F . ~ ) ,----- -
1__-__1_
E N D OF C O R P I t b T I O V : NO D I L 5 N O S T I C S .
DN NO, : 1.4-8-020 Page : 32
NAME : . " - QWT PURPOSE : . - Generates t h e transformation rnatri:, f r r r m the g iven
quatcrni on,
INPUT : - Q - The quater.r ran; A R R A Y ( 4 ) .
OUTPUT : A - The 3 x 3 transformation matrix
ALGORZTllMP\EFERENCE: - - - . . - - . Equation ( 1 5 ) f r o m S e c t i o n 2 . 2 .
Dl4 NO. : 1.4-8-020 Page: 33
QUATERt310N YO TtiE TRl\tlSFORi!ATIOI4 I IATRIX
NAME: - PURPOSE:
IIiPUT:
OUTPUT :
ON NU. : 1 .4-8-020 Page: 34
MATQ
Ex t rac ts t h e p o s i t i v e quaterni on f rom t h e given
transforn~ation m a t r i x .
A - The 3 x 3 t rans fo rn~a t ion m a t r i x
Q - The p o s i t i v e quaterni on;ARRAY (4 ) .
'ALGORITHM REFERENCE: See Reference 2.
DN 110. : 1.4-8-020 Page: 35
- S T O 2 h C . F ,555 Ibi.NEIkT ( I r L g C K , T Y P E , Gf L A T I V ~ L O ' C ~ T 1014, t ; A ~ : f 1 -
513iSI l e SUBF.GLlTlhC ! 4 A T C ! ( R , C 1 .. - ?* Jlt.:Ei\S'IRr4 A 13 , 3 1 , C ( q 1 , T ( i t 1 3C113.3 --- .--
jsictt 7 -+ -- -r PJ t ? O l C i 9JG=Sc S -. 48 30105 5 + SO 4L J = i r 4
6$ C I ( J ) = - ? [.-hL+--* , b * L ! bo7-m.*?-
--- a I 1-2 71= 8+ 1 F t J . - Z P . 3 ) LO I D 2 3 - ?+ - I F { J s L ' C , 4 I 50 TO 33 . . -.
3 ~ 1 2 2 120 G I J l = : .I# rgq - - -- ' --
c-9-1-2-1 3 l* = A t : , : ) 4 A ( ; , ; - l + & t 2 , ~ ~ + 3 * : 2 D 1 Z L 1 ?G T f J ) = J , ? -. E D 1 2 3 13* EO TCj
13 TEHPZ4tl 1 ) - A [ Z , z ) - s [ ; , , f l + l T.[-J"j-=..x-~.;-2 I-- &-.[ ;-,:.I-- -- - GO Tc Sf 15=
179 2; fE%?=-h[l ' ) + t . ( 7 r 7 ) - ' h ( j , 3 i + l . S - 13s T - t d b = A i 1 I 4 ; - A (5, il
3~ 12 10:: G C T O 3 5 ufil32 2Z* 3fj TEblP=-A( I ! l)-ht2;?lCk ( ; , 3 I * ? . ; - SO133 2 1 * T [ J ) = % [ ? , i l - f t f i , - l
35 T F I T E ? ' I - ' . L T . i ; I S ] b O T O q'2 ,; ~ - ~ - = - 1 ~ , p '-- - -- -.
iliiL3l *. c'Q .;r 1'3 35145 ~ 5 3 b O COhT I:.bE
1-F-t ?-.-L-Q.i-l+.GU- T O -5" . -
LLlG 4 27+ 4 1 1]= , . !~05 ,2?~- ( -? -15] - 331~1 5 L3+ I F ( I . ; . ~ ' . ~ I ! ) = A ~ - ' s . I ~ ' . ~ ~ ~ T ~ I ) / o ( I ) I - - CG147 2Q+ TE.?P=;2.25 / V t 1 1 30-1.5:'I ::$ L!P_-~L. J=2 tu 30153 33 u U( ~ 1 z ~ E . w ="ri~-l - 3G15q 325: Sfi C O N 1 ~ ~ J U F
Z Q 1 5 5 3 3~ 6 3 RETURN -- ;a157 34= EN13
&.
E P I D OF C O H P I L A T ~ O S : NO OT&CNOST 1 C S -
- '
-- ---
DN No. : 1 .4-8-020 Page: 36
NAME : - YPRQ
PUPPOSE: Generates the quaterni on d i rect ly frcm the yaw-
pitch-roll Euler angles, i .e . , a 3, 2, 1 Euler
sequence.
IPIPUT: YPR - The yaw-pitch-roll Euler angles J ARRAY ( 3 ) .
OUTPUT: Q0 - The p o s i t i v e qua te rn ion , ARRAY (4 ) .
ALGORITHM REFERENCE: Appendix A, t h e quaternion equations for Euler
sequence (lo), a 3, 2, 7 sequence.
NOTE: Th i s subrout ine ca l ls "POSNOR" t o t ake the normal o f t h e p o s i t i v e
quaterni an.
---- YAW-PITCIi-ROLI. EULER ArIGLES TO THE QUATERrJION -
5953 PUS i.:'J K ,73611 C O S r!n:3 SX.'*! - ---" -
I- ,7gCb N C R 2 3 ' i
DN NO* : 1.4-8-020 Page: 38
NAME: - POSHOR
PURPOSE: To o u t p u t t h e positive and nonnal i zed quaterni on
f rom t h e given quaternion.
INPUT: - Q - The quaternion; ARRAY (4).
OUTPUT: QO - The posi1;ive-normal ized quakern ion ;
ARRAY (a)., ALGORlTHM REFERENCE:
I . If the sign of Q(1) is negat ive:
Se t QO(T) = -Q(I) for I = 1, 2, 3, 4.
2. Se t QOfl) = QD(I)/TEMP
where TEMP = ~ Q O ; c (10; + QO; + Q O ~
SELECTS TCiE ,"3SITIVE Q!lATERf.IIOIl - AtlD ~IOP,MALIZES -.
S T O P , 1 s f 'OStcCrZ, POt , tJQr? FOIi 5 Z Z 3-1 ,2 / r G /7 7 - ; j G 2 : t t ! I
E N D 9F C O I I P I L A T I O U : NO 131 A G f : O S T i C S .