Mathc gnuplot/Application : Tangente 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,4.);
}
}
/* ------------------------------------ */
void arcL(
double **U,
double r,
double deg
)
{
for(;deg-->=0;)
{
GO(U,r);
TU(U,-4.);
}
}
/* ------------------------------------ */
void ray(
double **U,
double r
)
{
int i=2;
for(;i--;)
{
arcL(U,r,45./2.);
arcR(U,r,45./2.);
}
}
/* ------------------------------------ */
void sun(
double **U,
double size
)
{
int i=9;
for(;i--;)
{
ray(U,size);
TU(U,160.);
}
}
/* ------------------------------------ */
int main(void)
{
double **U = GINIT(-270.,80.,-40.,300.);
sun(U,4.);
F_mR(U);
printf(" ... load \"a_main.plt\" ... with gnuplot.\n");
getchar();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Résultat dans gnuplot |
---|
![]() |