Mathc matrices/c26a4
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c04.c */
int main(void)
double xy[8] ={ -5, -8,
 -2, 8,
 2, -8,
 5, 8 };
double **XY = ca_A_mR(xy,i_mR(R4,C2));
double **A = i_mR(R4,C4);
double **b = i_mR(R4,C1);
double **Ab = i_Abr_Ac_bc_mR(R4,C4,C1);
 clrscrn();
 printf("\n");
 printf(" Find the coefficients a, b, c of the curve \n\n");
 printf(" y = ax**3 + bx**2 + cx + d \n\n");
 printf(" that passes through the points. \n\n");
 printf(" x y \n");
 p_mR(XY,S5,P0,C6);
 printf("\n Using the given points, we obtain this matrix\n\n");
 printf(" x**3 x**2 x**1 x**0 y\n");
 i_A_b_with_XY_mR(XY,A,b);
 c_A_b_Ab_mR(A,b,Ab);
 p_mR(Ab,S7,P2,C6);
 stop();
 clrscrn();
 printf(" The Gauss Jordan process will reduce this matrix to : \n");
 gj_TP_mR(Ab);
 p_mR(Ab,S7,P2,C6);
 printf("\n The coefficients a, b, c of the curve are : \n\n");
 p_eq_poly_mR(Ab);
 stop();
 clrscrn();
 printf(" x y \n");
 p_mR(XY,S5,P0,C6);
 printf("\n");
 printf(" Verify the result : \n\n");
 verify_X_mR(Ab,XY[R1][C1]);
 verify_X_mR(Ab,XY[R2][C1]);
 verify_X_mR(Ab,XY[R3][C1]);
 verify_X_mR(Ab,XY[R4][C1]);
 printf("\n\n\n");
 stop();
 f_mR(XY);
 f_mR(A);
 f_mR(b);
 f_mR(Ab);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Find the coefficients a, b, c of the curve 
 y = ax**3 + bx**2 + cx + d 
 that passes through the points. 
 x y 
 -5 -8 
 -2 +8 
 +2 -8 
 +5 +8 
 Using the given points, we obtain this matrix
 x**3 x**2 x**1 x**0 y
-125.00 +25.00 -5.00 +1.00 -8.00 
 -8.00 +4.00 -2.00 +1.00 +8.00 
 +8.00 +4.00 +2.00 +1.00 -8.00 
+125.00 +25.00 +5.00 +1.00 +8.00 
 Press return to continue. 
 The Gauss Jordan process will reduce this matrix to : 
 +1.00 +0.00 +0.00 +0.00 +0.27 
 +0.00 +1.00 +0.00 +0.00 +0.00 
 +0.00 +0.00 +1.00 +0.00 -5.07 
 +0.00 +0.00 +0.00 +1.00 +0.00 
 The coefficients a, b, c of the curve are : 
 y = +0.267x**3 -5.067x**2
 Press return to continue. 
 x y 
 -5 -8 
 -2 +8 
 +2 -8 
 +5 +8 
 Verify the result : 
 With x = -5.000, y = -8.000 
 With x = -2.000, y = +8.000 
 With x = +2.000, y = -8.000 
 With x = +5.000, y = +8.000 
 Press return to continue.

Mathc matrices/c26a5
Application ou Résoudre avec ...
Installer et compiler ces fichiers dans votre répertoire de travail.
/* Save as : c05.c */
int main(void)
double xy[10] ={
 1, -5,
 2, 8,
 3, -7,
 4, 1,
 5, -4 };
double **XY = ca_A_mR(xy,i_mR(R5,C2));
double **A = i_mR(R5,C5);
double **b = i_mR(R5,C1);
double **Ab = i_Abr_Ac_bc_mR(R5,C5,C1);
 clrscrn();
 printf(" Find the coefficients a, b, c of the curve \n\n");
 printf(" y = ax**4 + bx**3 + cx**2 + dx + e \n\n");
 printf(" that passes through the points. \n\n");
 printf(" x y");
 p_mR(XY,S5,P0,C6);
 printf(" Using the given points, we obtain this matrix\n\n");
 printf(" x**4 x**3 x**2 x**1 x**0 y");
 i_A_b_with_XY_mR(XY,A,b);
 c_A_b_Ab_mR(A,b,Ab);
 p_mR(Ab,S7,P2,C6);
 stop();
 clrscrn();
 printf(" The Gauss Jordan process will reduce this matrix to : \n");
 gj_TP_mR(Ab);
 p_mR(Ab,S7,P2,C6);
 printf("\n The coefficients a, b, c of the curve are : \n\n");
 p_eq_poly_mR(Ab);
 stop();
 clrscrn();
 printf(" x y \n");
 p_mR(XY,S5,P0,C6);
 printf("\n");
 printf(" Verify the result : \n\n");
 verify_X_mR(Ab,XY[R1][C1]);
 verify_X_mR(Ab,XY[R2][C1]);
 verify_X_mR(Ab,XY[R3][C1]);
 verify_X_mR(Ab,XY[R4][C1]);
 verify_X_mR(Ab,XY[R5][C1]);
 printf("\n\n\n");
 stop();
 f_mR(XY);
 f_mR(A);
 f_mR(b);
 f_mR(Ab);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Find the coefficients a, b, c of the curve 
 y = ax**4 + bx**3 + cx**2 + dx + e 
 that passes through the points. 
 x y 
 +1 -5 
 +2 +8 
 +3 -7 
 +4 +1 
 +5 -4 
 Using the given points, we obtain this matrix
 x**4 x**3 x**2 x**1 x**0 y
 +1.00 +1.00 +1.00 +1.00 +1.00 -5.00 
 +16.00 +8.00 +4.00 +2.00 +1.00 +8.00 
 +81.00 +27.00 +9.00 +3.00 +1.00 -7.00 
+256.00 +64.00 +16.00 +4.00 +1.00 +1.00 
+625.00 +125.00 +25.00 +5.00 +1.00 -4.00 
 Press return to continue. 
 The Gauss Jordan process will reduce this matrix to : 
 +1.00 +0.00 +0.00 +0.00 +0.00 -3.63 
 +0.00 +1.00 +0.00 +0.00 +0.00 +44.75 
 +0.00 +0.00 +1.00 +0.00 +0.00 -191.88 
 -0.00 -0.00 -0.00 +1.00 -0.00 +329.75 
 +0.00 +0.00 +0.00 +0.00 +1.00 -184.00 
 The coefficients a, b, c of the curve are : 
 y = -3.625x**4 +44.750x**3 -191.875x**2 +329.750x -184.000
 Press return to continue. 
 x y 
 +1 -5 
 +2 +8 
 +3 -7 
 +4 +1 
 +5 -4 
 Verify the result : 
 With x = +1.000, y = -5.000 
 With x = +2.000, y = +8.000 
 With x = +3.000, y = -7.000 
 With x = +4.000, y = +1.000 
 With x = +5.000, y = -4.000 
 Press return to continue.

Mathc matrices/c26a6
Application
Installer et compiler ces fichiers dans votre répertoire de travail.
/* ------------------------------------ */
/* Save as : c06.c */
int main(void)
double xy[10] ={
 1, -2,
 2, -2,
 3, 3,
 4, -9,
 5, 4, };
double **XY = ca_A_mR(xy,i_mR(R5,C2));
double **A = i_mR(R5,C5);
double **b = i_mR(R5,C1);
double **Ab = i_Abr_Ac_bc_mR(R5,C5,C1);
 clrscrn();
 printf(" Find the coefficients a, b, c of the curve \n\n");
 printf(" y = ax**4 + bx**3 + cx**2 + dx + e \n\n");
 printf(" that passes through the points. \n\n");
 printf(" x y");
 p_mR(XY,S5,P0,C6);
 printf(" Using the given points, we obtain this matrix\n\n");
 printf(" x**4 x**3 x**2 x**1 x**0 y");
 i_A_b_with_XY_mR(XY,A,b);
 c_A_b_Ab_mR(A,b,Ab);
 p_mR(Ab,S7,P2,C6);
 stop();
 clrscrn();
 printf(" The Gauss Jordan process will reduce this matrix to : \n");
 gj_TP_mR(Ab);
 p_mR(Ab,S7,P2,C6);
 printf("\n The coefficients a, b, c of the curve are : \n\n");
 p_eq_poly_mR(Ab);
 stop();
 clrscrn();
 printf(" x y \n");
 p_mR(XY,S5,P0,C6);
 printf("\n");
 printf(" Verify the result : \n\n");
 verify_X_mR(Ab,XY[R1][C1]);
 verify_X_mR(Ab,XY[R2][C1]);
 verify_X_mR(Ab,XY[R3][C1]);
 verify_X_mR(Ab,XY[R4][C1]);
 verify_X_mR(Ab,XY[R5][C1]);
 printf("\n\n\n");
 stop();
 f_mR(XY);
 f_mR(A);
 f_mR(b);
 f_mR(Ab);
 return 0;
/* ------------------------------------ */

Exemple de sortie écran :
 Find the coefficients a, b, c of the curve 
 y = ax**4 + bx**3 + cx**2 + dx + e 
 that passes through the points. 
 x y 
 +1 -2 
 +2 -2 
 +3 +3 
 +4 -9 
 +5 +4 
 Using the given points, we obtain this matrix
 x**4 x**3 x**2 x**1 x**0 y
 +1.00 +1.00 +1.00 +1.00 +1.00 -2.00 
 +16.00 +8.00 +4.00 +2.00 +1.00 -2.00 
 +81.00 +27.00 +9.00 +3.00 +1.00 +3.00 
+256.00 +64.00 +16.00 +4.00 +1.00 -9.00 
+625.00 +125.00 +25.00 +5.00 +1.00 +4.00 
 Press return to continue. 
 The Gauss Jordan process will reduce this matrix to : 
 +1.00 +0.00 +0.00 +0.00 +0.00 +2.67 
 +0.00 +1.00 +0.00 +0.00 +0.00 -30.33 
 +0.00 +0.00 +1.00 +0.00 +0.00 +117.83 
 -0.00 -0.00 -0.00 +1.00 -0.00 -181.17 
 +0.00 +0.00 +0.00 +0.00 +1.00 +89.00 
 The coefficients a, b, c of the curve are : 
 y = +2.667x**4 -30.333x**3 +117.833x**2 -181.167x +89.000
 Press return to continue. 
 x y 
 +1 -2 
 +2 -2 
 +3 +3 
 +4 -9 
 +5 +4 
 Verify the result : 
 With x = +1.000, y = -2.000 
 With x = +2.000, y = -2.000 
 With x = +3.000, y = +3.000 
 With x = +4.000, y = -9.000 
 With x = +5.000, y = +4.000 
 Press return to continue.

Mathc matrices/26b
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 :
 Trouver les coefficients a, b, c, d, e du conique,
 ax**2 + by**2 + cx + dy + e = 0 
 qui passe par ces quatre points. 
 (x[1],y[1]) (x[2],y[2]) (x[3],y[3]) (x[4],y[4]) 
 En utilisant les quatre points nous obtenons la matrice.
 (a)x**2 (b)y**2 (c)x (d)y (e) = 0 
 x[1]**2 y[1]**2 x[1] y[1] 1 0
 x[2]**2 y[2]**2 x[2] y[2] 1 0
 x[3]**2 y[3]**2 x[3] y[3] 1 0
 x[4]**2 y[4]**2 x[4] y[4] 1 0
 Ce système à quatre lignes et cinq inconnus (a, b, c, d, e).
 C'est un système homogène, il a donc une infinité de solution.
 Pour trouver une solution j'ai choisi de poser que a = 1.
 Nous avons donc cinq lignes et cinq inconnus.