Aller au contenu

Mathc gnuplot/Tableau de pointeurs de fonctions

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_r.h"   
/* ------------------------------------ */   
double **tree(
double **U,
double brancheangle,
double branchelength,
double branchebranche,
double step,
double angletrunc                             
)
{
double j=angletrunc;
double i=branchelength;

  vo(U,+90.,branchelength);
    
  for(;i>0;i-=step,j+=angletrunc) 
     { 
       vo(U, brancheangle+90.,   i);                
       vo(U, brancheangle+90.,  -i);               
       vo(U,-brancheangle+90.,   i);            
       vo(U,-brancheangle+90.,  -i);
       vo(U,            j+90.,   i/branchebranche);                   
     } 
     
return(U); 
}   
/* ------------------------------------ */   
int main(void)
{
double **U = G_main(-40.,40.,-40.,40.);

double  branchebranche =  4.;                                                             
double   branchelength =  10.;                                          
double    brancheangle = -45.;                                                
double            step =  .5;                        

  setup(U,-20.,0.);
  tree(U,brancheangle,branchelength,branchebranche,step,2);  
      
  setup(U,0.,0.);
  tree(U,brancheangle,branchelength,branchebranche,step,4);
                 
  setup(U,20.,0.);
  tree(U,brancheangle,branchelength,branchebranche,step,6);  
      
  setup(U,-20.,-40.);
  tree(U,brancheangle,branchelength,branchebranche,step,8);  
      
  setup(U,0.,-40.);
  tree(U,brancheangle,branchelength,branchebranche,step,10);  
                 
  setup(U,20.,-40.);
  tree(U,brancheangle,branchelength,branchebranche,step,12);  

   F_mR(U);

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

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