Mathc matrices/h25c
Application
Installer ce fichier dans votre répertoire de travail.
/* Save as : d.h */
void verify_eq_parabola_mR(
double **A,
double x,
double y
double p = cofactor_R(A,R1,C1)*y 
 + cofactor_R(A,R1,C2)*pow(x,2) 
 + cofactor_R(A,R1,C3)*x 
 + cofactor_R(A,R1,C4);
 printf(" With x=%+5.1f y=%+5.1f eq=%+5.5f\n",x,y,p); 
/* ------------------------------------ */
double ** m_parabola_A_mR(
double **Ap,
double **A
int ra;
int r;
int c;
 for(c=C1;c<A[C_SIZE][C0];c++)A[R1][c]=1.; /* First line */
 for(r=R2,ra=R1; r<A[R_SIZE][C0]; r++,ra++)
 c=C1; A[r][c]= Ap[ra][C2]; /* y^1 */
 c++; A[r][c]= pow(Ap[ra][C1],2); /* x^2 */
 c++; A[r][c]= Ap[ra][C1]; /* x^1 */
 c++; A[r][c]= 1.; /* x^0*y^0*z^0 */

Mathc matrices/c25c1
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c01.c */
int main(void)
double p[R3*C2] ={ 1, 1, 
 2, 4, 
 3, 9 };
double **Ap = ca_A_mR(p, i_mR(R3,C2));
double **A = m_parabola_A_mR(Ap,i_mR(R4,C4));
int r;
 clrscrn();
 printf(" Theorem.\n\n");
 printf(" A homogeneous linear system with as many equations\n");
 printf(" as unknowns has a nontrivial solution if and only\n");
 printf(" if the determinant of the coefficient matrix is\n");
 printf(" zero.\n\n");
 printf(" Equation of a parabola: \n\n");
 printf(" c1 y + c2 x^2 + c3 x + c4 = 0\n\n"); 
 printf(" The same equation with the values of the three points:\n\n");
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" c1y%d + c2x%d^2 + c3x%d + c4 = 0\n",
 r,r,r); 
 printf("\n The four equation:\n\n");
 printf(" c1y + c2x^2 + c3x + c4 = 0\n"); 
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" c1y%d + c2x%d^2 + c3x%d + c4 = 0\n",
 r,r,r); 
 stop();
 clrscrn();
 printf(" The three points:\n\n");
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" P%d(%+.0f,%+.0f)",r,Ap[r][C1],Ap[r][C2]);
 printf(" The determinant :\n\n (cofactor expansion along the first row)\n\n");
 printf(" y x^2 x 1");
 p_Det_mR(A,6,0);
 printf(" The equation of the parabola : \n\n");
 printf(" %+.0f y %+.0f x^2 %+.0f x %+.0f = 0\n\n",
 cofactor_R(A,R1,C1),
 cofactor_R(A,R1,C2),
 cofactor_R(A,R1,C3),
 cofactor_R(A,R1,C4));
 printf(" Verify the result : \n\n"); 
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 verify_eq_parabola_mR(A, Ap[r][C1],
 Ap[r][C2]);

stop();
 f_mR(Ap);
 f_mR(A);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Theorem.
 A homogeneous linear system with as many equations
 as unknowns has a nontrivial solution if and only
 if the determinant of the coefficient matrix is
 zero.
 Equation of a parabola: 
 c1 y + c2 x^2 + c3 x + c4 = 0
 The same equation with the values of the three points:
 c1y1 + c2x1^2 + c3x1 + c4 = 0
 c1y2 + c2x2^2 + c3x2 + c4 = 0
 c1y3 + c2x3^2 + c3x3 + c4 = 0
 The four equation:
 c1y + c2x^2 + c3x + c4 = 0
 c1y1 + c2x1^2 + c3x1 + c4 = 0
 c1y2 + c2x2^2 + c3x2 + c4 = 0
 c1y3 + c2x3^2 + c3x3 + c4 = 0
 Press return to continue. 
 The three points:
 P1(+1,+1) P2(+2,+4) P3(+3,+9) The determinant :
 (cofactor expansion along the first row)
 y x^2 x 1
 +1 +1 +1 +1
 +4 +4 +2 +1
 +9 +9 +3 +1
 The equation of the parabola : 
 -2 y +2 x^2 -0 x -0 = 0
 Verify the result : 
 With x= +1.0 y= +1.0 eq=+0.00000
 With x= +2.0 y= +4.0 eq=+0.00000
 With x= +3.0 y= +9.0 eq=+0.00000
 Press return to continue.

Mathc matrices/c25c2
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c02.c */
int main(void)
double p[R3*C2] ={ -5, 1, 
 3,-3, 
 9, 9 };
double **Ap = ca_A_mR(p, i_mR(R3,C2));
double **A = m_parabola_A_mR(Ap,i_mR(R4,C4));
int r;
 clrscrn();
 printf(" Theorem.\n\n");
 printf(" A homogeneous linear system with as many equations\n");
 printf(" as unknowns has a nontrivial solution if and only\n");
 printf(" if the determinant of the coefficient matrix is\n");
 printf(" zero.\n\n");
 printf(" Equation of a parabola: \n\n");
 printf(" c1 y + c2 x^2 + c3 x + c4 = 0\n\n"); 
 printf(" The same equation with the values of the three points:\n\n");
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" c1y%d + c2x%d^2 + c3x%d + c4 = 0\n",
 r,r,r); 
 printf("\n The four equation:\n\n");
 printf(" c1y + c2x^2 + c3x + c4 = 0\n"); 
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" c1y%d + c2x%d^2 + c3x%d + c4 = 0\n",
 r,r,r); 
 stop();
 clrscrn();
 printf(" The three points:\n\n");
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 printf(" P%d(%+.0f,%+.0f)",r,Ap[r][C1],Ap[r][C2]);
 printf(" The determinant :\n\n (cofactor expansion along the first row)\n\n");
 printf(" y x^2 x 1");
 p_Det_mR(A,6,0);
 printf(" The equation of the parabola : \n\n");
 printf(" %+.0f y %+.0f x^2 %+.0f x %+.0f = 0\n\n",
 cofactor_R(A,R1,C1),
 cofactor_R(A,R1,C2),
 cofactor_R(A,R1,C3),
 cofactor_R(A,R1,C4));
 printf(" Verify the result : \n\n"); 
 for(r=R1;r<Ap[R_SIZE][C0];r++)
 verify_eq_parabola_mR(A, Ap[r][C1],
 Ap[r][C2]);

Exemple de sortie écran :
 Theorem.
 A homogeneous linear system with as many equations
 as unknowns has a nontrivial solution if and only
 if the determinant of the coefficient matrix is
 zero.
 Equation of a parabola: 
 c1 y + c2 x^2 + c3 x + c4 = 0
 The same equation with the values of the three points:
 c1y1 + c2x1^2 + c3x1 + c4 = 0
 c1y2 + c2x2^2 + c3x2 + c4 = 0
 c1y3 + c2x3^2 + c3x3 + c4 = 0
 The four equation:
 c1y + c2x^2 + c3x + c4 = 0
 c1y1 + c2x1^2 + c3x1 + c4 = 0
 c1y2 + c2x2^2 + c3x2 + c4 = 0
 c1y3 + c2x3^2 + c3x3 + c4 = 0
 Press return to continue. 
 The three points:
 P1(-5,+1) P2(+3,-3) P3(+9,+9) The determinant :
 (cofactor expansion along the first row)
 y x^2 x 1
 +1 +25 -5 +1
 -3 +9 +3 +1
 +9 +81 +9 +1
 The equation of the parabola : 
 -672 y +120 x^2 -96 x -2808 = 0
 Verify the result : 
 With x= -5.0 y= +1.0 eq=+0.00000
 With x= +3.0 y= -3.0 eq=+0.00000
 With x= +9.0 y= +9.0 eq=+0.00000
 Press return to continue.

Mathc matrices/25d
Application
Copier la bibliothèque dans votre répertoire de travail avec les fichiers des parties précédentes :
Ne pas conserver le fichier d.h avec la librairie après avoir testé les exemples. 
 Présentation :
 Un système linéaire homogène avec autant d'équation
 que d'inconnus a une solution non trivial si et 
 seulement le déterminant de cette matrice est nul.
 Calculons l'équation d'un cercle passant par les points P Q R :
 c1(x^2 +y^2) + c2 x + c3 y + c4 = 0
 Cette même équation avec les points P(x1,y1) Q(x2,y2) et R(x3,y3):
 c1(x1^2+y1^2) + c2 x1 + c3 y1 + c4 = 0
 c1(x2^2+y2^2) + c2 x2 + c3 y2 + c4 = 0
 c1(x3^2+y3^2) + c2 x3 + c3 y3 + c4 = 0
 Le système de quatre équations :
 c1(x^2 +y^2) + c2 x + c3 y + c4 = 0
 c1(x1^2+y1^2) + c2 x1 + c3 y1 + c4 = 0
 c1(x2^2+y2^2) + c2 x2 + c3 y2 + c4 = 0
 c1(x3^2+y3^2) + c2 x3 + c3 y3 + c4 = 0
 Le déterminant du système :
 |x^2 + y^2 x y 1|
 |x1^2+y1^2 x1 y1 1| = 0
 |x2^2+y2^2 x2 y2 1| 
 |x3^2+y3^2 x3 y3 1|

Le déterminant du système en language C : 
 | 1 1 1 1|
 |x1^2+y1^2 x1 y1 1| = 0
 |x2^2+y2^2 x2 y2 1| 
 |x3^2+y3^2 x3 y3 1|
 Pour calculer les coéficients de l'équation du cercle
 on utilise le développement sur la première ligne en 
 calculant les cofacteurs.
 cof(R1,C1)(x^2 + y^2) + cof(R1,C2) x + cof(R1,C3) y + cof(R1,C4) = 0
Cette équation nous donnes l'équation du cercle qui
 passe par les trois points P Q et R.
Deux exemples :

Mathc matrices/h25d
Application
Installer ce fichier dans votre répertoire de travail.
/* Save as : d.h */
double ** m_circle_A_mR(
double **Ap,
double **A
int ra;
int r;
int c;
int ct;
 for(c=C1;c<A[C_SIZE][C0];c++)A[R1][c]=1.; /* First line */
 for(r=R2,ra=R1; r<A[R_SIZE][C0]; r++,ra++)
 c=C1; 
 for(ct=C1;ct<Ap[C_SIZE][C0];ct++)
 A[r][c]+=pow(Ap[ra][ct],2); /* x^2+y^2 */
 c++; A[r][c]= Ap[ra][C1]; /* x^1 */
 c++; A[r][c]= Ap[ra][C2]; /* y^1 */
 c++; A[r][c]= 1.; /* x^0*y^0*z^0 */