Mathc matrices/a244
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double **U_T = r_mR(i_mR(R1, C3), 9);
double **V_T = r_mR(i_mR(R1, C3), 9);
double **W_T = r_mR(i_mR(R1, C3), 9);
double **UxV_T = i_mR(R1, C3);
double **UxW_T = i_mR(R1, C3);
double **UxV_T_pls_UxW_T = i_mR(R1, C3);
double **V_plus_W_T = add_mR(V_T,W_T,i_mR(R1, C3));
double **Ux_VplusW_T = i_mR(R1, C3);
double **A = rp_mR(i_mR(R3, C3), 1);
// (u x v)
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);
// (u x w)
c_r_mR(U_T, R1, A, R2);
c_r_mR(W_T, R1, A, R3);
c_s_mR(cofactor_R(A, R1, C1), UxW_T, R1, C1);
c_s_mR(cofactor_R(A, R1, C2), UxW_T, R1, C2);
c_s_mR(cofactor_R(A, R1, C3), UxW_T, R1, C3);
// (uxv) + (uxw)
add_mR(UxV_T,UxW_T,UxV_T_pls_UxW_T);
// u x (v+w)
c_r_mR(U_T, R1, A, R2);
c_r_mR(V_plus_W_T, R1, A, R3);
c_s_mR(cofactor_R(A, R1, C1), Ux_VplusW_T, R1, C1);
c_s_mR(cofactor_R(A, R1, C2), Ux_VplusW_T, R1, C2);
c_s_mR(cofactor_R(A, R1, C3), Ux_VplusW_T, R1, C3);
clrscrn();
printf(" u_T :");
p_mR(U_T, S4, P0, C6);
printf(" v_T :");
p_mR(V_T, S4, P0, C6);
printf(" w_T :");
p_mR(W_T, S4, P0, C6);
printf("\n\n"
" u x (v+w) == (uxv) + (uxw) \n\n"
" u x (v+w) :");
p_mR(Ux_VplusW_T, S5, P0, C6);
printf(" (uxv) + (uxw) :");
p_mR(UxV_T_pls_UxW_T, S5, P0, C6);
f_mR(U_T);
f_mR(V_T);
f_mR(W_T);
f_mR(UxV_T);
f_mR(UxW_T);
f_mR(UxV_T_pls_UxW_T);
f_mR(V_plus_W_T);
f_mR(Ux_VplusW_T);
f_mR(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
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 :
--------------------
u_T :
+8 +8 -2
v_T :
-3 +2 -2
w_T :
+9 -3 -6
u x (v+w) == (uxv) + (uxw)
u x (v+w) :
-66 +52 -56
(uxv) + (uxw) :
-66 +52 -56
Press return to continue
Press X return to stop