Mercurial > hg > octave-terminal
changeset 3235:41602f25d19f
[project @ 1999-03-05 07:14:08 by jwe]
author | jwe |
---|---|
date | Fri, 05 Mar 1999 07:14:08 +0000 |
parents | be8e0ba13644 |
children | 98e15955107e |
files | scripts/quaternion/demoquat.m scripts/quaternion/qcoordinate_plot.m scripts/quaternion/quaternion.m |
diffstat | 3 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/quaternion/demoquat.m +++ b/scripts/quaternion/demoquat.m @@ -206,7 +206,7 @@ [jvy,th] = quaternion(qtrans(jf,qyaw)); qpitch = quaternion(jvy(1:3),thp*pi/180); qb = qmult(qpitch, qyaw); - qi = quaternion([1 0 0],180*degrees); + qi = quaternion([1, 0, 0],180*degrees); printf("yaw=%8.4f, pitch=%8.4f, \n qbi = (%8.4f)i + (%8.4e)j + (%8.4f)k + (%8.4f)\n",thy,thp, ... qb(1), qb(2), qb(3), qb(4));
--- a/scripts/quaternion/qcoordinate_plot.m +++ b/scripts/quaternion/qcoordinate_plot.m @@ -29,7 +29,7 @@ # draw 1/3 circle in x-y plane around a unit z axis th = (0:-12:-120)*degrees*sign(th_eig); lth = length(th); -cpts = [0 0 0.1*cos(th) ; 0 0 0.1*sin(th); 0 1 1*ones(1,lth)]; +cpts = [0, 0, 0.1*cos(th) ; 0, 0, 0.1*sin(th); 0, 1, 1*ones(1,lth)]; # rotate the 1/3 circle around eigenaxis of inertial to body rotation # qez = qe/qz = rotation to get from z axis to eigenaxis.
--- a/scripts/quaternion/quaternion.m +++ b/scripts/quaternion/quaternion.m @@ -30,12 +30,12 @@ if(abs(theta) > pi) theta = theta - sign(theta)*pi; endif - sin_th_2 = norm([a b c]); + sin_th_2 = norm([a, b, c]); if(sin_th_2 != 0) vv = [a,b,c]/sin_th_2; else - vv = [a b c]; + vv = [a, b, c]; endif a = vv; b = theta; @@ -76,7 +76,7 @@ if ( !(is_scalar(w) & is_scalar(x) & is_scalar(y) & is_scalar(z)) ) error("input values must be scalars.") endif - a = [w x y z]; + a = [w, x, y, z]; otherwise, error("usage: [a,b,c,d] = quaternion(w), a = quaternion(w,x,y,z)")