Sommaire


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

c00a.c
/* ------------------------------------ */
/*  Save as :   c00a.c                  */
/* ------------------------------------ */
#include  "x_hfile.h"
/* ------------------------------------ */
int main(void)
{
CTRL_splot w;

  w.xmin = -10;
  w.xmax =  90;             
  w.ymin = -10;
  w.ymax =  50;

pt2d P0 = i_pt2d(40.,10.),
        P1 = i_pt2d(40.,40.),
        P2 = i_pt2d(60.,40.),
        P3 = i_pt2d(60.,10.);

 clrscrn();
 
 printf(" Graph the cubic bezier curve"
        " with the control points,\n\n"
        " P0,P1,P2,P3\n\n");

    G_Cubic_Bezier_2d(
             w,
             P0,P1,P2,P3
            );

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

 stop();
 
 clrscrn();
 
 printf(" Graph the cubic bezier curve"
        " without the control points,\n\n"
        " P0,P1,P2,P3\n\n");

    G_wp_Cubic_Bezier_2d(
             w,
             P0,P1,P2,P3
            );

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

 stop();
 
 return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Deux exemples : Dessiner une courbe avec les quatre points de contrôles,  puis sans les points de contrôles.