Mathc matrices/a107
Apparence
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
#define TAB C2
/* ------------------------------------ */
#define RU R2
#define CU C1
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double u[TAB][RU]={{+2,+2},
{+1,+5}};
double **U[TAB];
double **B = i_mR(RU,RU);
double w[RU] = {+2,+2};
double **W = ca_A_mR(w,i_mR(RU,C1));
double **BW = i_mR(RU,C1);
double **InvB = i_mR(RU,RU);
int c;
clrscrn();
for(c=C0; c<TAB; c++)
{
U[c] = ca_A_mR( u[c],i_mR(RU,C1));
c_c_mR(U[c],C1, B,c+C1);
}
printf(" Two U vectors in the Standard Basis \n\n"
" U[0] U[1] :");
p_mR(B,S6,P0,C10);
printf(" The W vector in the standard basis : ");
p_mR(W,S6,P0,C10);
printf(" Find the coordinate of W into the U basis");
mul_mR(inv_mR(B,InvB),W,BW);
p_mR(BW,S6,P0,C10);
stop();
for(c=C0; c<TAB; c++)
f_mR(U[c]);
f_mR(B);
f_mR(W);
f_mR(BW);
f_mR(InvB);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Les coordonnées de W dans la base U.
Exemple de sortie écran :
------------------------
Two U vectors in the Standard Basis
U[0] U[1] :
+2 +1
+2 +5
The W vector in the standard basis :
+2
+2
Find the coordinate of W into the U basis
+1
+0
Press return to continue.