/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        E T U D E   D E   L A   C O M P L E X I T E   S T R U C T U R E L L E                                                      */
/*        D ' U N E   S P I R A L E   C A R R E E   S U R   U N   T O R E  :                                                         */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xrC/ObjetComplexe.D1$vv$c' :                                                                                   */
/*                                                                                                                                   */
/*                    Jean-Francois Colonna (LACTAMME, 20130510115346).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

#ifdef    COMMENTS
#         undef     COMMENTS
#else
#endif

#define   COMMENTS  "Spirale carree sur un tore (format octet) -noir ou blanc-"

#include  "images_1octet.01.vv.I"

#ifndef   LONGUEUR
#         define    LONGUEUR                                                                                                            \
                              (4)
#else
#endif

#ifndef   INCREMENT
#         define    INCREMENT                                                                                                           \
                              (9)
#else
#endif

#ifndef   NOMBRE
#         define    NOMBRE                                                                                                              \
                              gDIVI(dimY,9)
#else
#endif

int       longueur=LONGUEUR;
int       increment=INCREMENT;
int       nombre=NOMBRE;

MAIN(
          {
          int       iteration;
          int       x1;
          int       y1;
          int       deltaX=1;
          int       deltaY=0;

          INITIALISATION_IMAGE(NOIR);

          x1=ADD2(Xmin,dimXs2);
          y1=ADD2(Ymin,dimYs2);

          for       (iteration=1 ; iteration <= nombre ; iteration=ADD2(iteration,1))
                    {
                    int       x2;
                    int       y2;
                    int       deltaX2;
                    int       deltaY2;
                    x2=ADD2(x1,MUL2(deltaX,longueur));
                    for       (x=MIN2(x1,x2) ; x <= MAX2(x1,x2) ; x=ADD2(x,1))
                              {
                              STORE_IMAGE_TORE(x,y1,BLANC);
                              }
                    x1=x2;
                    deltaX2=NEGA(deltaY);
                    deltaY2=NEUT(deltaX);
                    y2=ADD2(y1,MUL2(deltaY2,longueur));
                    for       (y=MIN2(y1,y2) ; y <= MAX2(y1,y2) ; y=ADD2(y,1))
                              {
                              STORE_IMAGE_TORE(x1,y,BLANC);
                              }
                    y1=y2;
                    deltaX=NEGA(deltaY2);
                    deltaY=NEUT(deltaX2);
                    longueur=ADD2(longueur,increment);
                    }

          SORTIE_DU_FICHIER_IMAGE;
          EDITER_LES_COMPTEURS_DES_FONCTIONS;
          }
     )



Copyright © Jean-François Colonna, 2013-2021.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / Ecole Polytechnique, 2013-2021.