/*************************************************************************************************************************************/ /* */ /* C A L C U L D E L A F O N C T I O N S I N U S C I R C U L A I R E : */ /* */ /* */ /* Author of '$xrc/tric_sin.21$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 19990628183617). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 : */ /* */ /*************************************************************************************************************************************/ @define PRAGMA_CL_____MODULE_NON_OPTIMISABLE /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE #include maths_compl_fonct_ITERATIONS_EXT #include image_image_QUAD_IMAGE_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D E F I N I T I O N S D E B A S E E T U N I V E R S E L L E S : */ /* */ /*************************************************************************************************************************************/ #include xrk/attractor.11.I" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define X_DEPART_GAUCHE \ PARE(0.0) #define X_DEPART_DROITE \ PARE(8.0) #define Y_DEPART_BAS \ PARE(-4.0) #define Y_DEPART_HAUT \ PARE(4.0) /* Definition de la fenetre de depart. */ #define X_ARRIVEE_GAUCHE \ X_DEPART_GAUCHE #define X_ARRIVEE_DROITE \ X_DEPART_DROITE #define Y_ARRIVEE_BAS \ Y_DEPART_BAS #define Y_ARRIVEE_HAUT \ Y_DEPART_HAUT /* Definition de la fenetre d'arrivee. */ #define PRECISION \ PARE(0.00001) \ /* Pour calculer le rapport de reduction. */ #define NOMBRE_D_IMAGES \ UN \ /* Nombre d'images a generer. */ #define PREMIERE_IMAGE \ NUMERO_DE_LA_PREMIERE_PERIODE_DE_LA_SIMULATION \ /* Numero de la premiere image a generer : ce parametre permet de faire une reprise sur une */ \ /* sequence interrompue. On notera qu'habituellement sa valeur est 'PREMIERE_IMAGE_ABSOLUE', */ \ /* mais que pour des raisons de compatibilite avec les differents modules inclus dans ce */ \ /* programme, on lui substitue 'NUMERO_DE_LA_PREMIERE_PERIODE_DE_LA_SIMULATION' partout... */ #define GENERER_LA_PARTIE_REELLE \ FAUX #define GENERER_LA_PARTIE_IMAGINAIRE \ FAUX #define GENERER_LE_MODULE \ VRAI #define GENERER_LA_PHASE \ VRAI /* Indicateurs controlant la generation des quatre types d'images. */ #define PRENDRE_UNE_DYNAMIQUE_LOGARITHMIQUE \ FAUX \ /* Lorsque 'EST_FAUX(les_images_sont_standards)' doit transformer logarithmiquement le */ \ /* Module, la partie Reelle et la partie Imaginaire ('VRAI') ou les laisser tels qu'ils */ \ /* ont ete calcules ('FAUX') ? */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #include xrc/ITERATION.11.I" /* Introduit le 20091122182748... */ #define GENERATION_D_UN_TYPE_D_IMAGE(generer_ce_type_d_image,nom_du_type_d_image,Fimage) \ Bblock \ Test(IL_FAUT(generer_ce_type_d_image)) \ Bblock \ EGAL(nom_image \ ,chain_Aconcaten2_sauf_nom_pipe(nom_du_type_d_image \ ,chain_numero(numero_d_image,nombre_de_chiffres) \ ) \ ); \ CALi(IupdateF_image(nom_image,Fimage)); \ CALZ_FreCC(nom_image); \ Eblock \ ATes \ Bblock \ Eblock \ ETes \ Eblock \ /* Procedure generant si necessaire un certain type d'image. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D E F I N I T I O N S D E L ' I N T E R P O L A T I O N D E S P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define numero_de_la_periode_courante \ numero_d_image #define nombre_de_periodes_de_la_simulation \ nombre_d_images /* Pour assurer la compatibilite avec '$xrq/nucleon.Lf.2.I'... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* C A L C U L D E L A F O N C T I O N S I N U S C I R C U L A I R E : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(complexe,coin_bas_gauche_de_depart_puis_courant); /* Definition du point situe en bas a gauche de la fenetre de depart, puis de la fenetre */ /* courante au cours du zoom. */ DEFV(complexe,coin_haut_droite_de_depart_puis_courant); /* Definition du point situe en haut a droite de la fenetre de depart, puis de la fenetre */ /* courante au cours du zoom. */ DEFV(complexe,coin_bas_gauche_d_arrivee); /* Definition du point situe en bas a gauche de la fenetre d'arrivee, */ DEFV(complexe,coin_haut_droite_d_arrivee); /* Definition du point situe en haut a droite de la fenetre d'arrivee. */ DEFV(Float,INIT(precision,PRECISION)); /* Pour calculer le rapport de reduction. */ DEFV(Float,INIT(rapport_de_reduction,FLOT__UNDEF)); /* Rapport de passage d'une fenetre a l'autre. */ DEFV(Int,INIT(nombre_d_images,NOMBRE_D_IMAGES)); /* Nombre d'images a generer. */ DEFV(Int,INIT(numero_d_image,NUMERO_DE_LA_PREMIERE_PERIODE_DE_LA_SIMULATION)); /* Numero de l'image courante (celle-ci n'est pas necessairement generee : voir */ /* le parametre 'PREMIERE_IMAGE'). */ DEFV(CHAR,INIC(POINTERc(nom_imageRR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageRI),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageRMo),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageRPh),NOM_PIPE)); /* Nom de la sequence d'images a generer. */ DEFV(Int,INIT(nombre_de_chiffres,NOMBRE_DE_CHIFFRES)); /* Nombre de chiffres codant le numero des images de la sequence a generer. */ DEFV(CHAR,INIT(POINTERc(nom_image),NOM_UNDEF)); /* Nom courant des images. */ DEFV(Logical,INIT(generer_la_partie_reelle,GENERER_LA_PARTIE_REELLE)); DEFV(Logical,INIT(generer_la_partie_imaginaire,GENERER_LA_PARTIE_IMAGINAIRE)); DEFV(Logical,INIT(generer_le_module,GENERER_LE_MODULE)); DEFV(Logical,INIT(generer_la_phase,GENERER_LA_PHASE)); /* Indicateurs controlant la generation des quatre types d'images. */ DEFV(Logical,INIT(prendre_une_dynamique_logarithmique,PRENDRE_UNE_DYNAMIQUE_LOGARITHMIQUE)); /* Lorsque 'EST_FAUX(les_images_sont_standards)' doit transformer logarithmiquement le */ /* Module, la partie Reelle et la partie Imaginaire ('VRAI') ou les laisser tels qu'ils */ /* ont ete calcules ('FAUX') ? */ /*..............................................................................................................................*/ Cinitialisation(coin_bas_gauche_de_depart_puis_courant,X_DEPART_GAUCHE,Y_DEPART_BAS); Cinitialisation(coin_haut_droite_de_depart_puis_courant,X_DEPART_DROITE,Y_DEPART_HAUT); /* Definition de la fenetre de depart. */ Cinitialisation(coin_bas_gauche_d_arrivee,X_ARRIVEE_GAUCHE,Y_ARRIVEE_BAS); Cinitialisation(coin_haut_droite_d_arrivee,X_ARRIVEE_DROITE,Y_ARRIVEE_HAUT); /* Definition de la fenetre d'arrivee. */ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(PROCESS_ARGUMENT_I("n=""images=""N=",nombre_d_images ,BLOC(VIDE;) ,BLOC(PRINT_AVERTISSEMENT("'n=''images=''N=' doit etre avant toute entree de fichiers");) ); GET_ARGUMENT_C("imageRR=""RR=",nom_imageRR); GET_ARGUMENT_C("imageRI=""RI=",nom_imageRI); GET_ARGUMENT_C("imageRMo=""RMo=",nom_imageRMo); GET_ARGUMENT_C("imageRPh=""RPh=",nom_imageRPh); GET_ARGUMENT_I("chiffres=",nombre_de_chiffres); GET_ARGUMENT_F("xbgd=""xbgD=",Reelle(coin_bas_gauche_de_depart_puis_courant)); GET_ARGUMENT_F("ybgd=""ybgD=",Imaginaire(coin_bas_gauche_de_depart_puis_courant)); GET_ARGUMENT_F("xhdd=""xhdD=",Reelle(coin_haut_droite_de_depart_puis_courant)); GET_ARGUMENT_F("yhdd=""yhdD=",Imaginaire(coin_haut_droite_de_depart_puis_courant)); GET_ARGUMENT_F("xbga=""xbgA=",Reelle(coin_bas_gauche_d_arrivee)); GET_ARGUMENT_F("ybga=""ybgA=",Imaginaire(coin_bas_gauche_d_arrivee)); GET_ARGUMENT_F("xhda=""xhdA=",Reelle(coin_haut_droite_d_arrivee)); GET_ARGUMENT_F("yhda=""yhdA=",Imaginaire(coin_haut_droite_d_arrivee)); GET_ARGUMENT_F("precision=",precision); GET_ARGUMENT_L("developpement_serie=""serie=""ds=" ,fFCsinus_circulaire_____utiliser_le_developpement_en_serie ); GET_ARGUMENT_I("indice_maximal_serie_trigonometrique=""imst=" ,CALCUL_TERME_COURANT_SERIE_TRIGONOMETRIQUE_____indice_maximal_d_une_serie_trigonometrique ); /* Arguments introduits le 20210209100246... */ GET_ARGUMENT_F("exposant=",FgCserie_sinus_____C_____exposant); /* Arguments introduits 20210217165737538... */ GET_ARGUMENT_L("puissance_unite_neutre=""pun=" ,CALCUL_TERME_COURANT_SERIE_TRIGONOMETRIQUE_____une_puissance_unite_est_neutre ); /* Arguments introduits le 20210218095704... */ GET_ARGUMENT_F("alpha=",fFCsinus_circulaire_____Halpha); GET_ARGUMENT_F("beta=",fFCsinus_circulaire_____Hbeta_); GET_ARGUMENT_F("gamma=",fFCsinus_circulaire_____Hgamma); GET_ARGUMENT_F("delta=",fFCsinus_circulaire_____Hdelta); /* Arguments introduits le 20091021163044... */ GET_ARGUMENT_L("genererR=""gR=",generer_la_partie_reelle); GET_ARGUMENT_L("genererI=""gI=",generer_la_partie_imaginaire); GET_ARGUMENT_L("genererMo=""gMo=",generer_le_module); GET_ARGUMENT_L("genererPh=""gPh=",generer_la_phase); /* Les abbreviations "g.=" et "g..=" ont ete introduites le 20210205115759... */ GET_ARGUMENT_L("logarithmique=""log=",prendre_une_dynamique_logarithmique); GET_ARGUMENT_L("editer_z_egal_f_de_z=""ezfz=",IJfonction_sinus_circulaire_dans_C_____edit); GET_ARGUMENT_L("simplifier_z_egal_f_de_z=""szfz=",IJfonction_sinus_circulaire_dans_C_____simp); /* Arguments introduits le 20120121182235 et completes le 20120124093234... */ ) ); CALCUL_DU_RAPPORT_DE_REDUCTION; DoIn(numero_d_image ,NUMERO_DE_LA_PREMIERE_PERIODE_DE_LA_SIMULATION ,LSTX(NUMERO_DE_LA_PREMIERE_PERIODE_DE_LA_SIMULATION,nombre_d_images) ,I ) Bblock Test(IFGE(numero_d_image,PREMIERE_IMAGE)) Bblock /* Afin de se positionner dans la sequence... */ BDEFV(imageJ,JimageR); BDEFV(imageF,FimageRR); BDEFV(imageF,FimageRI); BDEFV(imageF,FimageRMo); BDEFV(imageF,FimageRPh); /* Definition des images necessaires... */ CALi(IJinitialisation(JimageR,ADRESSE(C_____nombre_complexe__0__0))); CALi(IFinitialisation(FimageRR,FZERO)); CALi(IFinitialisation(FimageRI,FZERO)); CALi(IFinitialisation(FimageRMo,FZERO)); CALi(IFinitialisation(FimageRPh,FZERO)); /* Initialisation des images Resultat a priori... */ CALS(IJfonction_sinus_circulaire_dans_C(JimageR ,ADRESSE(coin_bas_gauche_de_depart_puis_courant) ,ADRESSE(coin_haut_droite_de_depart_puis_courant) ) ); /* Calcul de la fonction 'sinus'. */ CALS(Icomplexe_reelle(FimageRR,JimageR)); CALS(Icomplexe_imaginaire(FimageRI,JimageR)); /* Recuperation des parties Reelles et Imaginaires de la fonction 'sinus'. */ Test(IFOU(IL_FAUT(generer_le_module),IL_FAUT(generer_la_phase))) Bblock CALS(Iconversion_XY_RT(FimageRMo,FimageRPh ,FimageRR,FimageRI ) ); /* Puis calcul du Module et de la Phase dans [0,2.PI]. */ Eblock ATes Bblock Eblock ETes Test(IL_FAUT(prendre_une_dynamique_logarithmique)) Bblock CALS(IFdynamique_logarithmique_avec_translation_dynamique(FimageRR,FimageRR)); CALS(IFdynamique_logarithmique_avec_translation_dynamique(FimageRI,FimageRI)); CALS(IFdynamique_logarithmique_avec_translation_dynamique(FimageRMo,FimageRMo)); /* S'il le faut, la dynamique des images est reduite par application d'une fonction */ /* logarithme. Evidemment, cela ne concerne pas la phase... */ Eblock ATes Bblock Eblock ETes GENERATION_D_UN_TYPE_D_IMAGE(generer_la_partie_reelle ,nom_imageRR ,FimageRR ); GENERATION_D_UN_TYPE_D_IMAGE(generer_la_partie_imaginaire ,nom_imageRI ,FimageRI ); GENERATION_D_UN_TYPE_D_IMAGE(generer_le_module ,nom_imageRMo ,FimageRMo ); GENERATION_D_UN_TYPE_D_IMAGE(generer_la_phase ,nom_imageRPh ,FimageRPh ); /* Generation des images demandees. */ /* ATTENTION, on notera que l'on definit hors de 'Test(EST_VRAI(les_images_sont_standards))' */ /* simultanement les 'image' et les 'imageF'. Cela est du a l'utilisation de la procedure */ /* 'gIupdate_image(...)' dans 'GENERATION_D_UN_TYPE_D_IMAGE(...)'. */ EDEFV(imageF,FimageRPh); EDEFV(imageF,FimageRMo); EDEFV(imageF,FimageRI); EDEFV(imageF,FimageRR); EDEFV(imageJ,JimageR); /* Definition des images necessaires... */ Eblock ATes Bblock Eblock ETes REDUCTION_DE_LA_FENETRE_COURANTE; Eblock EDoI RETU_Commande; Eblock ECommande