Mathc initiation/Fichiers c : c29cd


Sommaire


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

c16c.c
/* --------------------------------- */
/* save as c16c.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include       "fc.h"
/* --------------------------------- */
int main(void)
{
double h = .0001;
pt3d   p = i_pt3d(-5,5,1);
v3d    u = grad_fxyz(f,h,p);

  clrscrn();
  
  printf("  f   : x,y,z -> %s\n\n\n",feq);
  printf("  p(%+.1f,%+.1f,%+.1f)\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(" %+.1f(x %+.1f)) %+.1f(y %+.1f) %+.1f(z %+.1f) = 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) = %+.1fi %+.1fj %+.1fk  \n\n",u.i,u.j,u.k);
  printf(" p(%+.1f,%+.1f,%+.1f)\n\n",p.x,p.y,p.z);
  stop();

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

  printf(" x=%+6.1f %+6.1f t\n y=%+6.1f %+6.1f t\n z=%+6.1f %+6.1f 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 -> x*y+2*y*z-x*z**2+10


  p(-5.0,+5.0,+1.0)

 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 :

 +4.0(x +5.0)) -3.0(y -5.0) +20.0(z -1.0) = 0


 grad(p) = +4.0i -3.0j +20.0k  

 p(-5.0,+5.0,+1.0)

 Press return to continue.


Exemple de sortie écran :

 The normal line is parallel to,

  grad(p)]p = +4.0i -3.0j +20.0k  


 and passes throught p(-5.0,+5.0,+1.0)

 x =  -5.0   +4.0 t
 y =  +5.0   -3.0 t
 z =  +1.0  +20.0 t



 Press return to continue.