Mercurial > hg > octave-lyh
comparison scripts/quaternion/qtrans.m @ 3224:1e7532b9173b
[project @ 1998-12-04 22:08:23 by jwe]
author | jwe |
---|---|
date | Fri, 04 Dec 1998 22:08:23 +0000 |
parents | |
children | a892190f4977 |
comparison
equal
deleted
inserted
replaced
3223:3ee04ff37b3e | 3224:1e7532b9173b |
---|---|
1 function v = qtrans(v,q) | |
2 # function v = qtrans(v,q) | |
3 # transform the unit quaternion v by the unit quaternion q; | |
4 # v = [w x y z], q = transformation quaternion | |
5 # returns v = q*v/q | |
6 | |
7 if(!is_vector(v) | length(v) != 4) | |
8 error(sprintf("qtrans: v(%d,%d) must be a quaternion",rows(v),columns(v))) | |
9 elseif(!is_vector(q) | length(q) != 4) | |
10 error(sprintf("qtrans: q(%d,%d) must be a quaternion",rows(q),columns(q))) | |
11 endif | |
12 | |
13 v = qmult(q,qmult(v,qinv(q))); |