Mathc matrices/h26c
Sommaire ◀ Utilise la commande "Retour en Arrière" de ton navigateur.
Installer ce fichier dans votre répertoire de travail.
d.h |
---|
/* ------------------------------------ */
/* Save as : d.h */
/* ------------------------------------ */
void i_A_b_with_XY_mR(
double **XY,
double **A,
double **b
)
{
int rXY;
int r;
int c;
c_s_mR(1.,A,R1,C1);
c_s_mR(1.,A,R2,C2);
for(r=R3,rXY=R1; r<A[R_SIZE][C0]; r++,rXY++)
{
c=C1; A[r][c]=pow(XY[rXY][C1],2); /* x**2 */
c++; A[r][c]=pow(XY[rXY][C2],2); /* y**2 */
c++; A[r][c]= XY[rXY][C1]; /* x */
c++; A[r][c]= XY[rXY][C2]; /* y */
c++; A[r][c]= 1.; /* c */
}
c_s_mR(1.,b,R1,C1);
c_s_mR(1.,b,R2,C1);
}
/* --------------------------------- */
void p_eq_circle_mR(
double **Ab
)
{
int cL = csize_R(Ab);
int r = R1;
if((Ab[r][cL]))printf(" %+.2fx**2 " ,Ab[r][cL]);
r++;if((Ab[r][cL]))printf(" %+.2fy**2 " ,Ab[r][cL]);
r++;if((Ab[r][cL]))printf(" %+.2fx " ,Ab[r][cL]);
r++;if((Ab[r][cL]))printf(" %+.2fy " ,Ab[r][cL]);
r++;if((Ab[r][cL]))printf(" %+.2f = 0\n\n\n",Ab[r][cL]);
else printf(" = 0\n\n\n");
}
/* --------------------------------- */
void verify_XY_mR(
double **Ab,
double x,
double y
)
{
int cL = csize_R(Ab);
double p = 0.;
int r = R1;
p+= Ab[r][cL]*pow(x,2);
r++;p+= Ab[r][cL]*pow(y,2);
r++;p+= Ab[r][cL]* x ;
r++;p+= Ab[r][cL]* y ;
r++;p+= Ab[r][cL] ;
printf(" With x = %+5.1f, y = %+5.1f ",x,y);
printf(" p = ax**2 + ay**2 + cx+ dy + e = %+5.5f\n",p);
}
/* ------------------------------------ */
/* ------------------------------------ */
Déclaration des fichiers h.