Mathc matrices/a243
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
int main(void)
{
double w_T[R1*C3] = { 5, 1, 9};
double u_T[R1*C3] = { 4, 2, 5};
double v_T[R1*C3] = { 3, 4, 1};
double **W_T = ca_A_mR(w_T , i_mR(R1, C3));
double **U_T = ca_A_mR(u_T , i_mR(R1, C3));
double **V_T = ca_A_mR(v_T , i_mR(R1, C3));
double **UxV_T = i_mR(R1, C3);
double **UxV = i_mR(R3, C1);
double **A = i_mR(R3, C3);
double **W = transpose_mR(W_T, i_mR(R3 , C1));
double **U = transpose_mR(U_T, i_mR(R3 , C1));
double **V = transpose_mR(V_T, i_mR(R3 , C1));
c_r_mR(W_T, R1, A, R1);
c_r_mR(U_T, R1, A, R2);
c_r_mR(V_T, R1, A, R3);
c_s_mR(cofactor_R(A, R1, C1), UxV_T, R1, C1);
c_s_mR(cofactor_R(A, R1, C2), UxV_T, R1, C2);
c_s_mR(cofactor_R(A, R1, C3), UxV_T, R1, C3);
transpose_mR(UxV_T, UxV);
clrscrn();
printf(" w_t :");
p_mR(W_T, S4, P0, C6);
printf(" u_t :");
p_mR(U_T, S4, P0, C6);
printf(" v_t :");
p_mR(V_T, S4, P0, C6);
printf(" uxv_t :");
p_mR(UxV_T, S4, P0, C6);
printf(" | 1 1 1 | | w1 w2 w3 | \n"
" w.(u x v) == w. | u1 u2 u3 | == | u1 u2 u3 | == det(A) \n"
" | v1 v2 v3 | | v1 v2 v3 | \n\n"
" w.(u x v) == %+.4f det(A) == %+.4f\n\n",
dot_R(W, UxV), det_R(A) );
stop();
f_mR(W_T);
f_mR(U_T);
f_mR(V_T);
f_mR(U);
f_mR(V);
f_mR(UxV_T);
f_mR(UxV);
f_mR(A);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Les vecteurs en mathématiques sont supposés être des vecteurs colonnes, c'est pour cela que j'utilise _T pour afficher des vecteurs lignes. Exemple de sortie écran :
--------------------
w_t :
+5 +1 +9
u_t :
+4 +2 +5
v_t :
+3 +4 +1
uxv_t :
-18 +11 +10
| 1 1 1 | | w1 w2 w3 |
w.(u x v) == w. | u1 u2 u3 | == | u1 u2 u3 | == det(A)
| v1 v2 v3 | | v1 v2 v3 |
w.(u x v) == +11.0000 det(A) == +11.0000
Press return to continue.