Mathc matrices/a130

Un livre de Wikilivres.


Application


Installer ces fichiers dans votre répertoire de travail.

Ce fichier est spécifique pour ce travail. Il ne doit pas être conservé avec la bibliothèque..'.

d_grotat.h
/* ------------------------------------ */
/*  Save as :   d_grotat.h              */
/* ------------------------------------ */
void G_rotateAxes_mR(
W_Ctrl w,
double **A,
double alpha
)
{
double **T;
double **X;
double **Xt;
double **Y;
double **Yt;

double   x[RC4] = {w.xmini,w.xmaxi,
                        0.,  0.};
double   y[RC4] = {     0.,  0.,
                   w.ymini,w.ymaxi};

FILE   *fp;

int      c;

 T  = i_mR(R2,C2); rot2D_mR(T,PI/180.*alpha);
 X  = i_mR(R2,C2); ca_A_mR(x,X);
 Y  = i_mR(R2,C2); ca_A_mR(y,Y);
 Xt = i_mR(R2,C2);
 Yt = i_mR(R2,C2);

 mul_mR(T,X,Xt);
 mul_mR(T,Y,Yt);

        fp = fopen("a_main.plt","w");
 fprintf(fp, " reset\n"
             " set zeroaxis\n"
             " set size ratio -1\n"
             " plot[%0.3f:%0.3f] [%0.3f:%0.3f]\\\n"
             " \"aa\" with line      lw 3,\\\n"
             " \"ax\" with line lt 3 lw 3,\\\n"
             " \"ay\" with line lt 3 lw 3\n",
             w.xmini,w.xmaxi,w.ymini,w.ymaxi);
       fclose(fp);

              fp = fopen("aa","w");
   for(c=C1; c<A[C_SIZE][R_SIZE]; c++)
      fprintf(fp,"  %+.3f  %+.3f \n",A[R1][c],A[R2][c]);
       fclose(fp);

              fp = fopen("ax","w");
      fprintf(fp,"  %+.3f  %+.3f \n",Xt[R1][C1],Xt[R2][C1]);
      fprintf(fp,"  %+.3f  %+.3f \n",Xt[R1][C2],Xt[R2][C2]);
       fclose(fp);

              fp = fopen("ay","w");
      fprintf(fp,"  %+.3f  %+.3f \n",Yt[R1][C1],Yt[R2][C1]);
      fprintf(fp,"  %+.3f  %+.3f \n",Yt[R1][C2],Yt[R2][C2]);
       fclose(fp);

 f_mR(T);
 f_mR(X);
 f_mR(Xt);
 f_mR(Y);
 f_mR(Yt);
}
/* ------------------------------------ */
/* ------------------------------------ */