Aller au contenu

Mathc gnuplot/Animation : Tangente d'une courbe

Un livre de Wikilivres.


Sommaire

Jeux sur les polygones

[modifier | modifier le wikicode]

N'oubliez pas les fichiers h de la librairie.


c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include "v_a.h"
#include "y_o.h"
/* ------------------------------------ */
void poly(
double **U,
double d,
double a,
double phasechange,
double n
)
{
double phase=0.;

  for(;n-->0;)
     {
      GO(U,d*cos(phase));
      TU(U,-a);
      phase+=phasechange;
     }
}
/* ------------------------------------ */
int main(void)
{
double **U = GINIT(-10.,10.,-10.,10.);

   clrscrn();

 /*  poly(U, d,   a,   phasechange, n) */
   SETUP(U,0.,-6., 1. );poly(U,7. , 45., 22.,100.);
   SETUP(U,0., 2., 4. );poly(U,2.5, 45., 24.,400.);
   SETUP(U,0.,-1.,-6. );poly(U,3. , 45., 25.,600.);
   SETUP(U,0., 2.,-7. );poly(U,4.5, 45., 30.,290.);

   F_mR(U);

  printf("  * open the file a_main.plt with Gnuplot.\n\n\n");

  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Résultat dans gnuplot
Turtles11