Mathc gnuplot/Animation : Cercle de courbure d'une courbe
Apparence
Exemple
[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 arcR(
double **U,
double r,
double deg
)
{
int i=0;
for(;i++<deg;)
{
if(fmod(i,2))GO(U,r);
else GU(U,r);
TU(U,1.);
}
}
/* ------------------------------------ */
void petal(
double **U,
double size
)
{
arcR(U,size,60.);
TU(U,120.);
arcR(U,size,60.);
TU(U,120.);
}
/* ------------------------------------ */
void flower(
double **U,
double size
)
{
int i=6;
for(;i--;)
{
petal(U,size);
TU(U,60.);
}
}
/* ------------------------------------ */
int main(void)
{
double **U = GINIT(-500.,500.,-500.,500.);
clrscrn();
flower(U,10.);
F_mR(U);
printf(" ... load \"a_main.plt\" ... with gnuplot.\n");
getchar();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Résultat dans gnuplot |
---|
![]() |