Aller au contenu

Mathc gnuplot/Application : Sous tangente

Un livre de Wikilivres.


Sommaire

N'oubliez pas les fichiers h de la librairie.

c00a.c
/* ------------------------------------ */
/*  Save as : c00a.c                    */
/* ------------------------------------ */
#include "v_a.h"
#include "y_o.h"
/* ------------------------------------ */
void fun(
double **U,
double step
)
{
int i=360/10;
int a=1;

  for(;i--;)
    {
     a= (a==1)?2:1;
     GO(U, a*step);
     GO(U,-a*step);
     TU(U,  10.);
    }
}
/* ------------------------------------ */
int main(void)
{
double **U = GINIT(-10.,10.,-10.,10.);

   clrscrn();
   
   fun(U,4.);

   F_mR(U);

  printf("  ... load \"a_main.plt\" ... with gnuplot.\n");
  getchar(); 

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