/*************************************************************************************************************************************/
/* */
/* G E N E R A T I O N D U O C T A E D R E R E G U L I E R : */
/* */
/* */
/* Author of '$xtc/OctaedreRegulier.01$vv$c' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20261006083504). */
/* */
/*************************************************************************************************************************************/
#define NSOMMETS 6
#define NARETES 12
#include "Polyedres.01.vv.I"
/*************************************************************************************************************************************/
/* */
/* G E N E R A T I O N D E S S O M M E T S D U D O D E C A E D R E : */
/* */
/*************************************************************************************************************************************/
double un_sur_racine_de_2;
/* Racine de 2... */
double Xmin_Octaedre=+INFINI,Ymin_Octaedre=+INFINI,Zmin_Octaedre=+INFINI;
double Xmax_Octaedre=-INFINI,Ymax_Octaedre=-INFINI,Zmax_Octaedre=-INFINI;
/* Extrema du dodecaedre=. */
static void octaedron(void)
{
int n=0;
int s1;
for (s1=-1; s1<=1; s1+=2)
{
p[n++] = (POINT){0,0,s1*un_sur_racine_de_2};
/* Generation de 4 sommets {0,0,(+/-1)*(1/Rac2)}. */
}
for (s1=-1; s1<=1; s1+=2)
{
p[n++] = (POINT){0,s1*un_sur_racine_de_2,0};
/* Generation de 4 sommets {0,(+/-1)*(1/Rac2),0}. */
}
for (s1=-1; s1<=1; s1+=2)
{
p[n++] = (POINT){s1*un_sur_racine_de_2,0,0};
/* Generation de 4 sommets {(+/-1)*(1/Rac2),0,0}. */
}
EXTREMA_SOMMETS(Xmin_Octaedre,Ymin_Octaedre,Zmin_Octaedre,Xmax_Octaedre,Ymax_Octaedre,Zmax_Octaedre);
}
/*************************************************************************************************************************************/
/* */
/* P R O G R A M M E P R I N C I P A L : */
/* */
/*************************************************************************************************************************************/
void main(int argc,char *argv[])
{
un_sur_racine_de_2 = 1/sqrt(2.0);
/* Valeur par defaut... */
if (argc >= 2)
{
GET_ARGUMENT(1,futur_un_sur_racine_de_2,un_sur_racine_de_2);
if (argc >= 3)
{
GET_ARGUMENT(2,futur_epsilon1,epsilon1);
if (argc >= 4)
{
GET_ARGUMENT(3,futur_epsilon2,epsilon2);
if (argc >= 5)
{
printf("Les arguments en sur-nombre sont ignores.\n");
}
else
{
}
}
else
{
}
}
else
{
}
}
else
{
}
octaedron();
EDITIONS_FINALES("Octaedre"
,Xmin_Octaedre,Ymin_Octaedre,Zmin_Octaedre
,Xmax_Octaedre,Ymax_Octaedre,Zmax_Octaedre
);
bonds("Octaedre");
return;
}