Aller au contenu

Mathc initiation/0067

Un livre de Wikilivres.


Sommaire

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

c00b.c
/* ---------------------------------- */
/* save as c00b.c                     */
/* ---------------------------------- */
#include "x_afile.h"
#include      "fb.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) = + 2*yi + cos(z)*xj  - sin(x)*yk 

   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)   = (-0.700,1.081,-2.990)

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

 Press return to continue.