Aller au contenu

Mathc matrices/03f

Un livre de Wikilivres.


Application

Installer et compiler ces fichiers dans votre répertoire de travail.

c00a.c
/* ------------------------------------ */
/*  Save as :  c00a.c                   */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define   RCA C3
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
-2,+1,+2,
+1,+2,+2,
+2,+2,-3
};

double R = 6;

double **A            = ca_A_mR(a,i_mR(RCA,RCA));
double **EigsVector   =           i_mR(RCA,RCA);
double **T_EigsVector =           i_mR(RCA,RCA);

double **T1 =  i_mR(RCA,RCA);
double **T2 =  i_mR(RCA,RCA);

  clrscrn();
  printf(" If %+.0fx^2 %+.0fy^2 %+.0fz^2 "
         " %+.0fxy %+.0fxz %+.0fyz= %+.0f \n\n"
         " Can you give a description of the curve "
         " in the standar basis?\n\n",
                A[R1][C1],     A[R2][C2],     A[R3][C3], 
             2*(A[R2][C1]), 2*(A[R3][C1]), 2*(A[R3][C2]), R);  

  printf(" A:");
  p_mR(A,S10,P4,C6);

  printf(" EigsVector:");
  eigs_V_mR(A,EigsVector); 
       p_mR(EigsVector,S10,P4,C6);

  printf(" EigsValue : T_EigsVector * A * EigsVector");   
  transpose_mR(EigsVector,T_EigsVector);   
        mul_mR(T_EigsVector,A,T1);
        mul_mR(T1,EigsVector,T2);
          p_mR(T2,S10,P4,C6);  

  printf(" Then : %+.3f x^2 %+.3f y^2 %+.3f z^2 = %.3f \n\n"
         " It is an hyperboloid of two sheets \n\n",
           T2[R1][C1], T2[R2][C2], T2[R3][C3], R); 
  stop();

  clrscrn();
  printf(" Copy/Past into the octave windows \n\n");
  p_Octave_mR(A,"a",P0);
  printf(" [V, E] = eigs (a,%d) \n\n",RCA);
  stop();
     
  f_mR(A);
  
  f_mR(EigsVector);
  f_mR(T_EigsVector);
   
  f_mR(T1);
  f_mR(T2);
  
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Si deux des valeurs propres sont négatives, alors l'équation de la surface est une hyperboloïde à deux nappes

Exemple de sortie écran :

 If -2x^2 +2y^2 -3z^2  +2xy +4xz +4yz= +6 

 Can you give a description of the curve  in the standar basis?

 A:
   -2.0000    +1.0000    +2.0000 
   +1.0000    +2.0000    +2.0000 
   +2.0000    +2.0000    -3.0000 

 EigsVector:
   -0.5444    +0.3118    +0.7788 
   -0.1638    +0.8710    -0.4632 
   +0.8227    +0.3797    +0.4231 

 EigsValue : T_EigsVector * A * EigsVector
   -4.7216    -0.0000    +0.0000 
   -0.0000    +3.2298    -0.0000 
   +0.0000    -0.0000    -1.5082 

 Then : -4.722 x^2 +3.230 y^2 -1.508 z^2 = 6.000 

 It is an hyperboloid of two sheets 

 Press return to continue.