Mathc matrices/03b
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
#define RCA R2
/* ------------------------------------ */
int main(void)
{
double a[RCA*RCA]={
+2,-2,
-2,+5};;
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 %+.0fxy = %+.0f \n\n"
" Can you give a description of the curve "
" in the standar basis?\n\n",
A[R1][C1], A[R2][C2], 2*(A[R1][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 : x^2/%.3f + y^2/%.3f = 1 \n\n",
pow(sqrt(R/T2[R1][C1]),2), pow(sqrt(R/T2[R2][C2]),2));
stop();
f_mR(A);
f_mR(EigsVector);
f_mR(T_EigsVector);
f_mR(T1);
f_mR(T2);
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Matrice symétrique: Si le produit des valeurs propres est positif, alors l'équation de la courbe est un cercle ou une ellipse.
Exemple de sortie écran :
If +2x^2 +5y^2 -4xy = +6
Can you give a description of the curve in the standar basis?
A:
+2.0000 -2.0000
-2.0000 +5.0000
EigsVector:
-0.4472 +0.8944
+0.8944 +0.4472
EigsValue : T_EigsVector * A * EigsVector
+6.0000 +0.0000
+0.0000 +1.0000
Then : x^2/1.000 + y^2/6.000 = 1
Press return to continue.