38 rmatrix rm1, rm2, rmx, rmy, rmz, rm3;
46 q2.
d.
x = q2.
d.
y = q2.
d.
z = sin(
RADOF(60.))/sqrt(3.);
48 printf(
"quaternion [%11f %11f %11f %11f] [%11f %11f %11f %11f]\n",q1.
w,q1.
d.
x,q1.
d.
y,q1.
d.
z,q2.
w,q2.
d.
x,q2.
d.
y,q2.
d.
z);
52 printf(
"[%11f %11f %11f] ",rvec1.
col[0],rvec1.
col[1],rvec1.
col[2]);
53 printf(
"[%11f %11f %11f] ",rvec2.
col[0],rvec2.
col[1],rvec2.
col[2]);
54 printf(
"[%11f %11f %11f]\n",rvec3.
col[0],rvec3.
col[1],rvec3.
col[2]);
68 printf(
"[%11f %11f %11f] ",rvec1.
col[0],rvec1.
col[1],rvec1.
col[2]);
69 printf(
"[%11f %11f %11f] ",rvec2.
col[0],rvec2.
col[1],rvec2.
col[2]);
70 printf(
"[%11f %11f %11f]\n",rvec3.
col[0],rvec3.
col[1],rvec3.
col[2]);
115 printf(
"[%11f %11f %11f]\n",rvec1.
col[0],rvec1.
col[1],rvec1.
col[2]);
127 uvec[i].r.col[j] = rand()-RAND_MAX/2.;
136 printf(
"vector [%11f %11f %11f] to [%11f %11f %11f]\n",uvec[i].c.x,uvec[i].
c.
y,uvec[i].
c.
z,uvec[(i+1)%4].
c.
x,uvec[(i+1)%4].
c.
y,uvec[(i+1)%4].
c.
z);
139 rm1 = rm_rtdcm(uvec[i].r,uvec[(i+1)%4].r);
142 printf(
"euler [%11f %11f %11f]\n",a1.
h,a1.
b,a1.
e);
143 printf(
"quaternion [%11f %11f %11f %11f]\n",q1.
d.
x,q1.
d.
y,q1.
d.
z,q1.
w);
153 printf(
"total dcm [ ");
163 printf(
"rotated [%11f %11f %11f] [%11f %11f %11f]",rvec1.
col[0],rvec1.
col[1],rvec1.
col[2],rvec2.
col[0],rvec2.
col[1],rvec2.
col[2]);
double y
Y value.
Definition: vector.h:114
quaternion q_euler2quaternion(avector rpw)
Definition: vector.cpp:1233
Quaternion/Rvector Union.
Definition: mathlib.h:155
rmatrix rm_quaternion2dcm(quaternion q)
Quaternion to row matrix Direction Cosine Matrix.
Definition: mathlib.cpp:219
rvector r
Definition: mathlib.h:161
3 element generic row vector
Definition: vector.h:53
int i
Definition: rw_test.cpp:37
cvector d
Orientation.
Definition: vector.h:405
Quaternion, scalar last, using x, y, z.
Definition: vector.h:402
void normalize_rv(rvector &v)
Normalize row order vector in place.
Definition: vector.cpp:222
double x
X value.
Definition: vector.h:112
double e
Elevation.
Definition: vector.h:282
rmatrix rm_eye()
Identity rmatrix.
Definition: matrix.cpp:114
rvector rv_unity(double scale)
Scaled y row vector.
Definition: vector.cpp:129
double b
Bank.
Definition: vector.h:284
3 element attitude vector.
Definition: vector.h:277
3x3 element generic matrix
Definition: matrix.h:41
quaternion q_dcm2quaternion_rm(rmatrix m)
Row matrix DCM to Quaternion.
Definition: rotation.cpp:178
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
rvector rv_unitz(double scale)
Scaled z row vector.
Definition: vector.cpp:140
double w
Rotation.
Definition: vector.h:407
rvector rv_zero()
Zero row order vector.
Definition: vector.cpp:107
avector a_quaternion2euler(quaternion q)
Definition: vector.cpp:1256
double z
Z value.
Definition: vector.h:116
rmatrix rm_mmult(rmatrix a, rmatrix b)
rmatrix Matrix Product
Definition: matrix.cpp:198
double col[3]
Definition: vector.h:55
double h
Heading.
Definition: vector.h:280
cvector c
Definition: mathlib.h:162
rvector rv_unitx(double scale)
Scaled x row vector.
Definition: vector.cpp:118
rvector rv_mmult(rmatrix m, rvector v)
Multiply rmatrix by rvector.
Definition: matrix.cpp:41
rvector row[3]
Definition: matrix.h:43
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29