Linear Algebra and the C Language/a0bq
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(int r)
{
double **Q = r_Q_mR(i_mR(r,r), 9);
clrscrn();
printf(" Q : An orthonormal matrix\n\n"
" det(Q) = 1 or -1\n\n");
p_mR(Q,S3,P3,C6);
printf(" det(Q) = %.0f\n\n",det_R(Q));
f_mR(Q);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun(rp_I(R3)+R2);
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Screen output example:
Q : An orthonormal matrix
det(Q) = 1 or -1
-0.593 -0.431 +0.364 +0.575
+0.074 -0.497 +0.566 -0.654
+0.445 +0.433 +0.709 +0.335
+0.667 -0.617 -0.212 +0.360
det(Q) = 1
Press return to continue
Press X return to stop