Mathc initiation/Fichiers c : c29cb


Sommaire


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

c16b.c
/* --------------------------------- */
/* save as c16b.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include       "fb.h"
/* --------------------------------- */
int main(void)
{
double h = .001;
pt3d   p = i_pt3d(1,0,1);
v3d    u = grad_fxyz(f,h,p);
 
  clrscrn(); 
  
  printf("  f   : x,y,z -> %s\n\n\n",feq);
  printf("  p(%+.3f,%+.3f,%+.3f)\n\n",p.x,p.y,p.z);

  printf(" Find equations for the tangent plane\n");
  printf(" and the  normal line to the graph of\n");
  printf(" the equation at the point P.\n\n\n");

  printf(" The equations for the tangent plane is :\n\n");
  printf(" %+.3f(x %+.3f)) %+.3f(y %+.3f) %+.3f(z %+.3f) = 0\n\n\n",
           fxyz_x(f,h,p), -p.x,
           fxyz_y(f,h,p), -p.y,
           fxyz_z(f,h,p), -p.z);

  printf(" grad(p)]p = %+.3fi %+.3fj %+.3fk  \n\n",u.i,u.j,u.k);
  printf(" p(%+.3f,%+.3f,%+.3f)\n\n",p.x,p.y,p.z);
  stop();

  clrscrn();
  
  printf(" The normal line is parallel to,\n\n");
  
  printf("  grad(p) = %+.3fi %+.3fj %+.3fk  \n\n\n",u.i,u.j,u.k);
  printf(" and passes throught p(%+.3f,%+.3f,%+.3f)\n\n",p.x,p.y,p.z);

  printf(" x=%+6.3f %+6.3f t\n y=%+6.3f %+6.3f t\n z=%+6.3f %+6.3f t\n\n\n\n",
           p.x, fxyz_x(f,h,p),
           p.y, fxyz_y(f,h,p),
           p.z, fxyz_z(f,h,p));

  stop();

 return 0;
}

/* --------------------------------- 

 An equation for the tangent plane to the graph 
 of z = f(x,y,z) at the point (x0,y0,z0) is

 f_x(x0,y0,z0)(x-x0)+f_y(x0,y0,z0)(y-y0)+f_z(x0,y0,z0)(z-z0) = 0

 A normal vector of z = f(x,y,z) at 
 the point (x0,y0,z0) is

 grad(p)]p0 = f_x(x0,y0,z0)i+f_y(x0,y0,z0)j+f_z(x0,y0,z0)k

------------------------------------ */
/* --------------------------------- */
/* --------------------------------- */


L'équation du plan tangent au point P0 est donnée par :

f_x(x0,y0,z0)(x-x0)+f_y(x0,y0,z0)(y-y0)+f_z(x0,y0,z0)(z-z0) = 0


Le vecteur normal au point P0 est donné par le gradient :

grad(p)]p0 = f_x(x0,y0,z0)i+f_y(x0,y0,z0)j+f_z(x0,y0,z0)k


Les équations paramétriques de la droite normale au point P0 est donné par  :
x=  x0  + f_x(x0,y0,z0) t

y=  y0  + f_y(x0,y0,z0) t

z=  z0  + f_z(x0,y0,z0) t


Exemple de sortie écran :

  f   : x,y,z -> 2*exp(-x) * cos(y) - z


  p(+1.000,+0.000,+1.000)

 Find equations for the tangent plane
 and the  normal line to the graph of
 the equation at the point P.


 The equations for the tangent plane is :

 -0.736(x -1.000)) +0.000(y -0.000) -1.000(z -1.000) = 0


 grad(p)]p = -0.736i +0.000j -1.000k  

 p(+1.000,+0.000,+1.000)

 Press return to continue.


Exemple de sortie écran :

 The normal line is parallel to,

  grad(p) = -0.736i +0.000j -1.000k  


 and passes throught p(+1.000,+0.000,+1.000)

 x=+1.000 -0.736 t
 y=+0.000 +0.000 t
 z=+1.000 -1.000 t



 Press return to continue.