Mathc matrices/h26b
Apparence
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;
A[R1][C1]=1;
for(r=R2,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**1 */
c++; A[r][c]= XY[rXY][C2]; /* y**1 */
c++; A[r][c]= 1.;
}
b[R1][C1]=1;
}
/* --------------------------------- */
void p_eq_conica_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
)
{
double p = 0.;
int cL = csize_R(Ab);
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 and y = %+5.1f",x,y);
printf(" ax**2 + by**2 + cx+ dy + e = %+5.5f \n",p);
}
/* ------------------------------------ */
/* ------------------------------------ */
Déclaration des fichiers h.