home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
octa21eb.zip
/
octave
/
SCRIPTS.ZIP
/
scripts
/
quaternion
/
qtrans.m
< prev
next >
Wrap
Text File
|
1998-10-23
|
446b
|
14 lines
function v = qtrans(v,q)
# function v = qtrans(v,q)
# transform the unit quaternion v by the unit quaternion q;
# v = [w x y z], q = transformation quaternion
# returns v = q*v/q
if(!is_vector(v) | length(v) != 4)
error(sprintf("qtrans: v(%d,%d) must be a quaternion",rows(v),columns(v)))
elseif(!is_vector(q) | length(q) != 4)
error(sprintf("qtrans: q(%d,%d) must be a quaternion",rows(q),columns(q)))
endif
v = qmult(q,qmult(v,qinv(q)));