Mathc initiation/Fichiers h : c60fd

Un livre de Wikilivres.


Sommaire


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

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

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

CTRL_splot p;

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

 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))(x-f(t))+g(t) = ");
 eq_Normal(f,g,DgDf,t.value);
 
 printf("\n\n\n");

 printf(" Find PA, the length of the Normal from P to the x axis.\n\n");

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

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

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

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

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Find PA, the length of the Normal from P to the x axis in c language and gnuplot

Exemple de sortie écran :

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

 f : t-> cos(t)  
 g : t-> sin(t)

 With t = 0.785, the equation of the normal is :

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


 Find PA, the length of the Normal from P to the x axis.

 P( 0.707,  0.707)    P(t), g(t)) 
 A( 0.000,  0.000)    A(g(t)(DgDf)(t)+f(t), 0)


 PA =  sqrt(g(t)**2*(DgDf(t)**2+1))
    =  1.000

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

 Press return to continue.