Aller au contenu

Mathc initiation/0066

Un livre de Wikilivres.


Sommaire

Installer et compiler ces fichiers dans votre répertoire de travail.

c00a.c
/* ---------------------------------- */
/* save as c00a.c                     */
/* ---------------------------------- */
#include "x_afile.h"
#include      "fa.h"
/* ---------------------------------- */
int main(void)
{
pt3d p3d  = {1, 2, 3};
v3d  curl = curl_ijk(M,N,P, p3d);

 clrscrn();

 printf(" F(x,y,z) = %si %sj %sk \n\n",Meq,Neq,Peq);

 printf("   with F = Mi + Nj + Pk \n\n" 
 
        "             |  i       j      k | \n"
        "             | _x      _y     _z | \n"
        "             |  M       N      P | \n\n"
        
        "   curl(F)   = [(P_y-N_z)i + (M_z-P_x)j + (N_x-M_y)k] \n\n" 

        "   curl(F)   = (%.3f,%.3f,%.3f)\n\n"
        
        " Compute the Norm of the curl:\n\n"        
        " ||curl(F)|| = %.3f \n\n"
               
        , curl.i,curl.j,curl.k,
         Ncurl_ijk(M,N,P, p3d));
 
 stop();
 
 return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */

Exemple de sortie écran :

 F(x,y,z) = + 3*z*yi + 4*xj  + 2*y*xk 

   with F = Mi + Nj + Pk 

             |  i       j      k | 
             | _x      _y     _z | 
             |  M       N      P | 

   curl(F)   = [(P_y-N_z)i + (M_z-P_x)j + (N_x-M_y)k] 

   curl(F)   = (2.000,2.000,-5.000)

 Compute the Norm of the curl:
 
 ||curl(F)|| = 5.745 

 Press return to continue.