Mathc initiation/Fichiers h : c45fb


Sommaire


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

c00d.c
/* --------------------------------- */
/* save as c00d.c                    */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fd.h"
/* --------------------------------- */
int main(void)
{
tvalue t;

  t.value =   2*PI/4.;
  t.min   =        0.; 
  t.max   =     2.*PI;  
  t.step  =       .05;  

CTRL_splot p;

  p.xmin = -4;
  p.xmax =  4;             
  p.ymin = -4;
  p.ymax =  4;

 clrscrn();
 
 printf(" Let C be the curve consisting of all ordered pairs\n");
 printf(" (f(t),g(t)), with\n\n");
 printf(" f : t-> %s  \n", feq);
 printf(" g : t-> %s\n\n", geq);

 printf(" With t = %0.3f, the equation of the Normal is :\n\n",t.value);
 printf(" y =  (-1/(Dg/Df)(t.value))(x-f(t.value))+g(t.value) = ");
 eq_Normal(f,g,DgDf,t.value);
 
 printf("\n\n\n");
 
 printf(" Find PB, the length of the Normal from P to the y axis.\n\n");

 printf(" P(%6.3f, %6.3f)    P(f(t), g(t))\n", 
        f(t.value),g(t.value));

 printf(" B(+0.000, %6.3f)    B(0, f(t)/DgDf(t)+g(t))\n\n\n",
          f(t.value)/DgDf(t.value)+g(t.value)   ); 

 printf(" PB =  sqrt(f(t)**2*(1+1/DgDf(t)**2))\n"); 
 printf("    = %6.3f\n\n", 
       sqrt(pow(f(t.value),2)*(1+pow(1/DgDf(t.value),2))));
                                                  
 G_Normal_Ly(p,
             f,g,DgDf,
             t
            );

 printf(" To see the graph, open the file \"a_main.plt\" with Gnuplot.\n\n");
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Find PB, the length of the Normal from P to the y axis. in c language with gnuplot


Exemple de sortie écran :

 Let C be the curve consisting of all ordered pairs
 (f(t),g(t)), with

 f : t-> (a-b)*cos(t)+b*cos((a-b/b)*t)  
 g : t-> (a-b)*sin(t)-b*sin((a-b/b)*t)

 With t = 1.571, the equation of the Normal is :

 y =  (-1/(Dg/Df)(t.value))(x-f(t.value))+g(t.value) =  1.000*x +3.000


 Find PB, the length of the Normal from P to the y axis.

 P(-1.000,  2.000)    P(f(t), g(t))
 B(+0.000,  3.000)    B(0, f(t)/DgDf(t)+g(t))


 PB =  sqrt(f(t)**2*(1+1/DgDf(t)**2))
    =  1.414

 To see the graph, open the file "a_main.plt" with Gnuplot.

 Press return to continue.