/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        G E N E R A T I O N   D E   V A L E U R S   C O R R E S P O N D A N T   A U X                                              */
/*        C O O R D O N N E E S   S U R   U N E   S P I R A L E   C A R R E E  :                                                     */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Definition :                                                                                                               */
/*                                                                                                                                   */
/*                    Cette commande donne comme resultat une                                                                        */
/*                  liste de combinaisons lineaires des abscisses                                                                    */
/*                  et des ordonnees {X,Y} de points sur une                                                                         */
/*                  spirale carree.                                                                                                  */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xci/valeurs_spir$K' :                                                                                          */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 19990202145239).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        I N T E R F A C E   ' listG '  :                                                                                           */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        :Debut_listG:                                                                                                              */
/*        :Fin_listG:                                                                                                                */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        D I R E C T I V E S   S P E C I F I Q U E S   D E   C O M P I L A T I O N  :                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        F I C H I E R S   D ' I N C L U D E S  :                                                                                   */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  INCLUDES_BASE

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P A R A M E T R E S  :                                                                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  xci/sequence.01.I"
#include  xci/coordonne.01.I"

#define   EDITER_DES_COORDONNEES_NORMALISEES                                                                                            \
                    VRAI                                                                                                                \
                                        /* Faut-il editer des coordonnees normalisees ('VRAI') ou denormalisees ('FAUX') ?           */ \
                                        /* Ceci fut introduit le 20140204175555...                                                   */

#define   PONDERATION_DE_X                                                                                                              \
                    FU
#define   PONDERATION_DE_Y                                                                                                              \
                    FZERO
                                        /* Ponderations respectives de 'X' et de 'Y'.                                                */

#define   FACTEUR_DE_X                                                                                                                  \
                    FU
#define   FACTEUR_DE_Y                                                                                                                  \
                    FU
                                        /* Homotheties respectives de 'X' et de 'Y'.                                                 */

#include  xci/valeurs.01.I"

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        M A C R O S   U T I L E S  :                                                                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#include  xci/valeurs.02.I"

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        G E N E R A T I O N   D E   V A L E U R S   C O R R E S P O N D A N T   A U X                                              */
/*        C O O R D O N N E E S   S U R   U N E   S P I R A L E   C A R R E E  :                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
     Bblock
#include  xci/coordonne.02.I"

     DEFV(Int,INIT(premiere_image,PREMIERE_IMAGE));
                                        /* Numero de la premiere image,                                                              */
     DEFV(Int,INIT(derniere_image,DERNIERE_IMAGE));
                                        /* Numero de la derniere image.                                                              */
     DEFV(Int,INIT(numero_d_image,UNDEF));
                                        /* Numero de l'image courante.                                                               */
     DEFV(Int,INIT(pas_des_images,PAS_DES_IMAGES));
                                        /* Pas de passage d'un numero d'image a une autre.                                           */

     DEFV(Logical,INIT(editer_des_coordonnees_normalisees,EDITER_DES_COORDONNEES_NORMALISEES));
                                        /* Faut-il editer des coordonnees normalisees ('VRAI') ou denormalisees ('FAUX') ?           */
                                        /* Ceci fut introduit le 20140204175555...                                                   */

     DEFV(Float,INIT(ponderation_de_X,PONDERATION_DE_X));
     DEFV(Float,INIT(ponderation_de_Y,PONDERATION_DE_Y));
                                        /* Ponderations respectives de 'X' et de 'Y'.                                                */
     DEFV(Float,INIT(facteur_de_X,FACTEUR_DE_X));
     DEFV(Float,INIT(facteur_de_Y,FACTEUR_DE_Y));
                                        /* Homotheties respectives de 'X' et de 'Y'.                                                 */

#include  xci/valeurs.03.I"
     /*..............................................................................................................................*/

#include  xci/coordonne.04.I"
                                        /* Ceci a ete introduit le 20051218183402...                                                 */

     GET_ARGUMENTSi(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_I("premiere=""p=""D=",premiere_image);
                         GET_ARGUMENT_I("derniere=""d=""A=",derniere_image);
                         GET_ARGUMENT_I("pas=",pas_des_images);

                         GET_ARGUMENT_L("coordonnees_normalisees=""cn=",editer_des_coordonnees_normalisees);
                         GET_ARGUMENT_N("coordonnees_denormalisees=""cdn=",editer_des_coordonnees_normalisees);
                                        /* Arguments introduits le 20140204175555...                                                 */

                         GET_ARGUMENT_L("centrer=",centrer_les_coordonnees_normalisees);

                         GET_ARGUMENT_F("Px=""PX=",ponderation_de_X);
                         GET_ARGUMENT_F("Py=""PY=",ponderation_de_Y);

                         GET_ARGUMENT_F("ax=""aX=""Ax=""AX=",facteur_de_X);
                         GET_ARGUMENT_F("ay=""aY=""Ay=""AY=",facteur_de_Y);

                         GET_ARGUMENT_F("bx=""bX=""Bx=""BX=",translation_des_X_normalisees);
                         GET_ARGUMENT_F("by=""bY=""By=""BY=",translation_des_Y_normalisees);

                         PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_1;
                                        /* Cette procedure fut introduite le 20061226185943...                                       */
                         )
                    );

     Test(IFLE(premiere_image,derniere_image))
          Bblock
          DEFV(pointI_2D,point_courant);
                                        /* Point (entier) courant.                                                                   */

          SPIRALE_DEFINITION
                                        /* Donnees de generation d'une spirale de parcours d'une image.                              */

          SPIRALE_VALIDATION;
                                        /* Validation des pas de parcours (pasX,pasY) des images.                                    */
          INITIALISATION_POINT_2D(point_courant,Xcentre,Ycentre);
                                        /* Et on se place au centre de l'image.                                                      */

#include  xci/coordonne.03.I"

          DoIn(numero_d_image,premiere_image,derniere_image,pas_des_images)
               Bblock
               Test(IL_FAUT(editer_des_coordonnees_normalisees))
                                        /* Test introduit le 20140204175555...                                                       */
                    Bblock
                    CAL2(Prin2(Cara(chain_Aconcaten5(INTRODUCTION_FORMAT,valeurs_signees,".*",format_d_edition,"\n"))
                              ,NOMBRE_DE_DECIMALES_EFFECTIF(nombre_de_decimales)
                              ,MULTIPLE_DE(ENTIER_FLOTTANT(LIZ2(ponderation_de_X
                                                               ,AXPB(facteur_de_X
                                                                    ,SUPER_cNORMALISE_OX(ASD1(point_courant,x))
                                                                    ,translation_des_X_normalisees
                                                                     )
                                                               ,ponderation_de_Y
                                                               ,AXPB(facteur_de_Y
                                                                    ,SUPER_cNORMALISE_OY(ASD1(point_courant,y))
                                                                    ,translation_des_Y_normalisees
                                                                     )
                                                                )
                                                           )
                                           )
                               )
                         );
                                        /* Et enfin, edition d'une combinaison lineaire des coordonnees du point courant.            */
                    Eblock
               ATes
                    Bblock
                    CAL2(Prin1(Cara(chain_Aconcaten4(INTRODUCTION_FORMAT,valeurs_signees,"d","\n"))
                              ,INTE(LIZ2(ponderation_de_X
                                        ,FLOT(ASD1(point_courant,x))
                                        ,ponderation_de_Y
                                        ,FLOT(ASD1(point_courant,y))
                                         )
                                    )
                               )
                         );
                    Eblock
               ETes

               SPIRALE_INITIALISATION;
                                        /* Initialisation dynamique de 'spirale_nombre_de_points_a_traiter'.                         */
               SPIRALE_DEPLACEMENT(ASD1(point_courant,x),ASD1(point_courant,y));
                                        /* Deplacement du point courant de la spirale...                                             */
                                        /* ATTENTION : on n'utilise pas 'SPIRALE_DEPLACEMENT_ET_PARCOURS(...)' afin de garantir le   */
                                        /* traitement de tous les points de l'image...                                               */
               SPIRALE_PARCOURS;
                                        /* Parcours de la spirale avec rotation eventuelle de PI/2 du bras courant...                */
               Eblock
          EDoI
          Eblock
     ATes
          Bblock
          PRINT_ERREUR("la relation d'ordre stricte ('premier < dernier') n'est pas respectee");
          Eblock
     ETes

     RETU_Commande;
     Eblock
ECommande



Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.