Linear Algebra and the C Language/a0jl
Install and compile this file in your working directory.
/* ------------------------------------ */
/* Save as : c00b.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double s = 6;
double u_T[R1*C3] = { 4, 2, 5};
double **U_T = ca_A_mR(u_T , i_mR(R1,C3));
double **V_T = smul_mR(s,U_T, i_mR(R1,C3));
double **UxV_T = UxV_mR(U_T,V_T, i_mR(R1,C3));
clrscrn();
printf(" s = %+.0f\n\n",s);
printf(" u_T:");
p_mR(U_T, S4, P0, C6);
printf(" v_T:");
p_mR(V_T, S4,P0,C6);
printf("\n\n"
" If u and v are colinear then u x v == 0\n\n"
" (uxv):");
p_mR(UxV_T, S5,P0,C6);
stop();
f_mR(U_T);
f_mR(V_T);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
If u and v are colinear then u x v == 0:
Screen output example:
s = +6
u_T:
+4 +2 +5
v_T:
+24 +12 +30
If u and v are colinear then u x v == 0
(uxv):
+0 -0 -0
Press return to continue.