FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» PANORAMIC V 1
Biomorphe de Pickover Emptypar jjn4 Hier à 17:49

» select intégrés [résolu]
Biomorphe de Pickover Emptypar jjn4 Hier à 17:00

» number_mouse_up
Biomorphe de Pickover Emptypar jjn4 Hier à 11:59

» Aide de PANORAMIC
Biomorphe de Pickover Emptypar jjn4 Hier à 11:16

» trop de fichiers en cours
Biomorphe de Pickover Emptypar lepetitmarocain Hier à 10:43

» Je teste PANORAMIC V 1 beta 1
Biomorphe de Pickover Emptypar papydall Hier à 4:17

» bouton dans autre form que 0
Biomorphe de Pickover Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
Biomorphe de Pickover Emptypar Klaus Lun 6 Mai 2024 - 11:41

» Gestion d'un système client-serveur.
Biomorphe de Pickover Emptypar Klaus Lun 6 Mai 2024 - 10:23

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Biomorphe de Pickover Emptypar Froggy One Jeu 2 Mai 2024 - 11:16

» @Jack
Biomorphe de Pickover Emptypar Jack Mar 30 Avr 2024 - 20:40

» Une calculatrice en une ligne de programme
Biomorphe de Pickover Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Biomorphe de Pickover Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
Biomorphe de Pickover Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
Biomorphe de Pickover Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le deal à ne pas rater :
Cartes Pokémon 151 : où trouver le coffret Collection Alakazam-ex ?
Voir le deal

 

 Biomorphe de Pickover

Aller en bas 
+2
Jack
papydall
6 participants
AuteurMessage
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 3:52

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 23/09/2018
rem        Ref : http://www.madteddy.com/biomorph.htm
rem ============================================================================
rem                   Z³ + Constante Complexe
rem             z³ = (x+iy)³ = (x³ - 3xy²) + (3x²y - y³)i
rem              Constante complexe : C = real + (imag)i
rem ============================================================================
' Pour obtenir le symbole de l'exposant ³ taper <ALT> + 252
rem  Appel : Z_Cube(xmax,ymax,real,imag)
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
 Z_Cube(2.5125,1.88,0.5,0)
' Z_Cube(2,2,0.5,0.5)
' Z_Cube(2.5,2,0,0)
' Z_Cube(2.45,1.5,0.5,0.1)
end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' z³ = (x+iy)³ = (x³ - 3xy²) + (3x²y - y³)i
SUB Z_Cube(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x,y,x0,y0,xx,yy,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z³ + C avec C = " + str$(real) + " " + s$ + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                xx = x * (x * x - 3 * y * y) + real : ' Cette ligne et la suivante donnent
                yy = y * (3 * x * x - y * y) + imag : ' le cube du nombre, plus une constante
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Résultat:


Le temps du tracé est un peu long, mais avec l’arrivée prochaine ( ? ) du compilateur, ça sera une autre histoire !


Dernière édition par papydall le Dim 23 Sep 2018 - 15:45, édité 2 fois
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 3:57

Et un autre biomorphe

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 23/09/2018
rem        Ref : http://www.madteddy.com/biomorph.htm
rem ============================================================================
rem         exp(y)*(1/abs(tan(x)) + abs(sin(x)) i) + C
rem     avec C constante complexe sous forme real + (imag)i
rem ============================================================================
rem Appel : Biomorphe(xmax,ymax,real,imag)
rem Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
 Biomorphe(13.364,10,0.5,0)
' Biomorphe(13.364,10,0.5,0.5)
end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 +20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,10 : left 20,40 : font_bold 20 : font_size 20,12
    font_color 20,100,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' exp(y)*(1/abs(tan(x)) + abs(sin(x)) i)
SUB Biomorphe(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local nlimit : nlimit = 100
    dim n1 : n1 = sqr(nlimit)
    dim_local x,y,x0,y0,xx,yy,i,j,n,t$,s$  
    if imag >= 0 then s$ = "+"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    t$ = "exp(y)*(1/abs(tan(x)) + abs(sin(x)) i) + Constante complexe"+ chr$(13)
    t$ = t$ + string$(20," ") + "Constante complexe = "
    t$ = t$ + str$(real) + " " + s$ + str$(imag) +" i"
    caption 20,t$
    FOR i = 0 TO ilimit
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO nlimit
                xx = exp(y)*(1/abs(tan(x))) + real
                yy = exp(y)*abs(sin(x))+ imag
                x = xx : y = yy
                IF (ABS(x) > n1) OR (ABS(y) > n1) or ((x*x + y*y) > nlimit)  THEN exit_for        
            NEXT n
            IF (ABS(x) > n1) and (ABS(y) > n1)
               2d_pen_color 0,0,0
            else
               if (abs(x) > n1) and (abs(y) <= n1)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= n1) and (abs(y) > n1)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Résultat:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Jack
Admin
Jack


Nombre de messages : 2386
Date d'inscription : 28/05/2007

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 7:17

Dans le premier listing, la ligne 69 ne passe pas la compilation (il manque ")

Après correction, voici le résultat de la compilation:

http://panoramic-language.pagesperso-orange.fr/PICKOVER1.zip

http://panoramic-language.pagesperso-orange.fr/PICKOVER2.zip

_________________
Biomorphe de Pickover Webdav username : panoramic@jack-panoramic password : panoramic123
Revenir en haut Aller en bas
https://panoramic.1fr1.net
Marc

Marc


Nombre de messages : 2391
Age : 63
Localisation : TOURS (37)
Date d'inscription : 17/03/2014

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 10:29

Biomorphe de Pickover 128


C'est du grand Art !  cheers

Il ne manque plus que la signature de l'artiste sur ce beau tableau  Very Happy

Merci Papydall et merci à Jack pour la compilation !
Revenir en haut Aller en bas
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 17:14

Merci Jack pour la compilation.
Merci  Marc pour le retour.

Bon, je continue avec les biomorphes.

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 23/09/2018
rem ============================================================================
rem                   Z² + Constante Complexe
rem             z² = (x+iy)² = (x² - y²) + (2xy)i
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem  Appel : Z_Carre(xmax,ymax,real,imag)
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
 Z_Carre(2.5125,1.88,0.4,0.7)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' z² = (x + iy)² = (x² - y²) + (2xy)i
SUB Z_Carre(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x,y,x0,y0,xx,yy,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z² + C avec C = " + str$(real) + " " + s$ + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100          
                xx = x*x - y*y + real : ' Cette ligne et la suivante donnent  
                yy = 2*x*y + imag     : ' le carré du nombre plus une constante          
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================

Spoiler:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 17:22

Encore un autre biomorphe.

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 23/09/2018
rem ============================================================================
rem                   Z^4 + Constante Complexe
rem       z^4 = (x+iy)^4 = (x^4 - 6x²y² + y^4) + 4xy(x²-y²)i
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem  Appel : Z4(xmax,ymax,real,imag)
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
 Z4(2.6729,2,0.5,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' z^4 = (x+iy)^4 = (x^4 - 6x²y² + y^4) + 4xy(x²-y²)i
SUB Z4(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x,y,x0,y0,xx,yy,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^4 + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100                        
                xx = x*x*x*x - 6*x*x*y*y + y*y*y*y + real
                yy = 4*x*y*(x*x - y*y) + imag              
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Spoiler:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Jack
Admin
Jack


Nombre de messages : 2386
Date d'inscription : 28/05/2007

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyDim 23 Sep 2018 - 19:45


_________________
Biomorphe de Pickover Webdav username : panoramic@jack-panoramic password : panoramic123
Revenir en haut Aller en bas
https://panoramic.1fr1.net
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyLun 24 Sep 2018 - 0:00

Merci Jack.
C'est très gentil de ta part!
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
jean_debord

jean_debord


Nombre de messages : 1250
Age : 69
Localisation : Limoges
Date d'inscription : 21/09/2008

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyLun 24 Sep 2018 - 9:10

Merci papydall Smile

Les fonctions z^n + c sont classiques. As-tu essayé avec un exposant fractionnaire ?

La fonction avec exp, tan et sin donne des résultats intéressants.

Je vais la tester avec mon programme.
Revenir en haut Aller en bas
http://www.unilim.fr/pages_perso/jean.debord/index.htm
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 0:12

jean_debord a écrit:
Les fonctions z^n + c sont classiques. As-tu essayé avec un exposant fractionnaire ?

J’ai tenté zz (z à la puissance z)

Ça donne le code suivant
Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 24/09/2018
rem ============================================================================
rem                   z^z + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem La fonction z^z peut être exprimée par :
rem z^z = exp(z*log(z) = exp((x+yi)*log(x+yi))
rem On utilise l’algorithme suivant :
rem logreal = log(sqr(x*x + y*y))
rem logimag = atn(y/x)
rem if x < 0 and y > 0 alors ajouter pi à logimag
rem if x < 0 and y < 0 alors soustraire pi de logimag
rem indexreal = x * logreal - y * logimag
rem indeximag = x * logimag + y * logreal
rem fonction = exp(indexreal)*(cos(indeximag) + sin(indeximag) i)
rem ============================================================================
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
Z_Puissance_Z(5.3458,4,0.001,0)
end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
SUB Z_Puissance_Z(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^Z + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                calcul()                      
                xx = xx + real : yy = yy + imag : x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================
' Calculer la partie réelle et la partie imaginaire de la fonction complexe z^z
SUB Calcul()
    dim_local logreal,logimag,indexreal,indeximag
    logreal = log(sqr(x*x + y*y))
    logimag = atn(y/x)
    if x < 0 and y > 0 then logimag = logimag + pi
    if x < 0 and y < 0 then logimag = logimag - pi
    indexreal = x * logreal - y * logimag
    indeximag = x * logimag + y * logreal
    xx = exp(indexreal)*cos(indeximag)
    yy = exp(indexreal)*sin(indeximag)
END_SUB
rem ============================================================================

J’ai lancé le programme pour voir ce que ça va donner.
Comme je vois que l’affichage est d’une lenteur à languir, j’ai laissé le programme tourner et je suis allé chercher ma petite-fille à l’école.
De retour, ça rame toujours mais l’image est prometteuse.
Bref, après un temps très long, j’ai pu admirer

cette image:

Puis j'ai vu que l’image de la fonction z z  présente une symétrie horizontale.
Il suffit donc de balayer l’écran de 0 à ilimit/2 et de tracer deux points (j,i) et (j,ilimit-i) pour un même calcul.
De cette façon on réduit le temps du tracé de la moitié.
Voici le code modifié.
Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 24/09/2018
rem ============================================================================
rem                   z^z + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem La fonction z^z peut être exprimée par :
rem z^z = exp(z*log(z) = exp((x+yi)*log(x+yi))
rem On utilise l’algorithme suivant :
rem logreal = log(sqr(x*x + y*y))
rem logimag = atn(y/x)
rem if x < 0 and y > 0 alors ajouter pi à logimag
rem if x < 0 and y < 0 alors soustraire pi de logimag
rem indexreal = x * logreal - y * logimag
rem indeximag = x * logimag + y * logreal
rem fonction = exp(indexreal)*(cos(indeximag) + sin(indeximag) i)
rem ============================================================================
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
Z_Puissance_Z(5.3458,4,0.1,0)
end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
SUB Z_Puissance_Z(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^Z + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                calcul()                      
                xx = xx + real : yy = yy + imag : x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i :  display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================
' Calculer la partie réelle et la partie imaginaire de la fonction complexe z^z
SUB Calcul()
    dim_local logreal,logimag,indexreal,indeximag
    logreal = log(sqr(x*x + y*y))
    logimag = atn(y/x)
    if x < 0 and y > 0 then logimag = logimag + pi
    if x < 0 and y < 0 then logimag = logimag - pi
    indexreal = x * logreal - y * logimag
    indeximag = x * logimag + y * logreal
    xx = exp(indexreal)*cos(indeximag)
    yy = exp(indexreal)*sin(indeximag)
END_SUB
rem ============================================================================

Résultat:



Bon je vais continuer mon exploration et faire un zoom sur une autre région de l'image juste pour le plaisir...

A toute à l'heure!
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 0:33

Modification du code précédent et son résultat.

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 24/09/2018
rem ============================================================================
rem                   z^z + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem La fonction z^z peut être exprimée par :
rem z^z = exp(z*log(z) = exp((x+yi)*log(x+yi))
rem On utilise l’algorithme suivant :
rem logreal = log(sqr(x*x + y*y))
rem logimag = atn(y/x)
rem if x < 0 and y > 0 alors ajouter pi à logimag
rem if x < 0 and y < 0 alors soustraire pi de logimag
rem indexreal = x * logreal - y * logimag
rem indeximag = x * logimag + y * logreal
rem fonction = exp(indexreal)*(cos(indeximag) + sin(indeximag) i)
rem ============================================================================
rem  Vous pouvez jouer sur les valeurs xmax, ymax et/ou sur la constante complexe (real, imag)
rem ============================================================================
Init()
Z_Puissance_Z(3.3411,1,0.5,0)
end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
SUB Z_Puissance_Z(xmax,ymax,real,imag)
    dim_local ymin : ymin = -1*ymax
    dim_local xmin : xmin = -1*xmax
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^Z + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                calcul()                      
                xx = xx + real : yy = yy + imag : x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i :  display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================
' Calculer la partie réelle et la partie imaginaire de la fonction complexe z^z
SUB Calcul()
    dim_local logreal,logimag,indexreal,indeximag
    logreal = log(sqr(x*x + y*y))
    logimag = atn(y/x)
    if x < 0 and y > 0 then logimag = logimag + pi
    if x < 0 and y < 0 then logimag = logimag - pi
    indexreal = x * logreal - y * logimag
    indeximag = x * logimag + y * logreal
    xx = exp(indexreal)*cos(indeximag)
    yy = exp(indexreal)*sin(indeximag)
END_SUB
rem ============================================================================


Résultat:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 0:49

Une autre région de zz

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 24/09/2018
rem ============================================================================
rem                   z^z + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem La fonction z^z peut être exprimée par :
rem z^z = exp(z*log(z) = exp((x+yi)*log(x+yi))
rem On utilise l’algorithme suivant :
rem logreal = log(sqr(x*x + y*y))
rem logimag = atn(y/x)
rem if x < 0 and y > 0 alors ajouter pi à logimag
rem if x < 0 and y < 0 alors soustraire pi de logimag
rem indexreal = x * logreal - y * logimag
rem indeximag = x * logimag + y * logreal
rem fonction = exp(indexreal)*(cos(indeximag) + sin(indeximag) i)
rem ============================================================================
rem Appel : Z_Puissance_Z(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
Z_Puissance_Z(0.6987654321,3.123456,-1,1,0.1,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' La fonction z^z présente une symétrie horizontale, il suffit de balayer l’écran
' de 0 à ilimit/2 et de tracer deux points (j,i) et (j,ilimit-i) pour un même calcul
' De cette façon on réduit le temps du tracé de la moitié.

SUB Z_Puissance_Z(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^Z + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                calcul()                      
                xx = xx + real : yy = yy + imag : x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================
' Calculer la partie réelle et la partie imaginaire de la fonction complexe z^z
SUB Calcul()
    dim_local logreal,logimag,indexreal,indeximag
    logreal = log(sqr(x*x + y*y))
    logimag = atn(y/x)
    if x < 0 and y > 0 then logimag = logimag + pi
    if x < 0 and y < 0 then logimag = logimag - pi
    indexreal = x * logreal - y * logimag
    indeximag = x * logimag + y * logreal
    xx = exp(indexreal)*cos(indeximag)
    yy = exp(indexreal)*sin(indeximag)
END_SUB
rem ============================================================================


Résultat:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 1:09

Et pour clore cette série ...

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 25/09/2018
rem ============================================================================
rem                   z^z + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem La fonction z^z peut être exprimée par :
rem z^z = exp(z*log(z) = exp((x+yi)*log(x+yi))
rem On utilise l’algorithme suivant :
rem logreal = log(sqr(x*x + y*y))
rem logimag = atn(y/x)
rem if x < 0 and y > 0 alors ajouter pi à logimag
rem if x < 0 and y < 0 alors soustraire pi de logimag
rem indexreal = x * logreal - y * logimag
rem indeximag = x * logimag + y * logreal
rem fonction = exp(indexreal)*(cos(indeximag) + sin(indeximag) i)
rem ============================================================================
rem Appel : Z_Puissance_Z(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
Z_Puissance_Z(0.6682,3.3411,-1,1,0.01,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,20 : left 20,100 : font_bold 20 : font_size 20,18
    font_color 20,0,100,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' La fonction z^z présente une symétrie horizontale, il suffit de balayer l’écran
' de 0 à ilimit/2 et de tracer deux points (j,i) et (j,ilimit-i) pour un même calcul
' De cette façon on réduit le temps du tracé de la moitié.

SUB Z_Puissance_Z(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$
    if imag >= 0 then s$ = "+"
    caption 20,"Z^Z + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i"
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                calcul()                      
                xx = xx + real : yy = yy + imag : x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================
' Calculer la partie réelle et la partie imaginaire de la fonction complexe z^z
SUB Calcul()
    dim_local logreal,logimag,indexreal,indeximag
    logreal = log(sqr(x*x + y*y))
    logimag = atn(y/x)
    if x < 0 and y > 0 then logimag = logimag + pi
    if x < 0 and y < 0 then logimag = logimag - pi
    indexreal = x * logreal - y * logimag
    indeximag = x * logimag + y * logreal
    xx = exp(indexreal)*cos(indeximag)
    yy = exp(indexreal)*sin(indeximag)
END_SUB
rem ============================================================================


Admirez ! :
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Minibug

Minibug


Nombre de messages : 4566
Age : 57
Localisation : Vienne (86)
Date d'inscription : 09/02/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 7:32

Merci Papydall pour toutes ces belles choses que tu nous proposes. cheers

Cela parait tellement simple lorsque c'est toi qui les programme ! Laughing
Revenir en haut Aller en bas
http://gpp.panoramic.free.fr
jean_debord

jean_debord


Nombre de messages : 1250
Age : 69
Localisation : Limoges
Date d'inscription : 21/09/2008

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMar 25 Sep 2018 - 9:25

Je n'obtiens pas d'images très esthétiques avec la fonction en exp/tan/sin. C'est sans doute dû à ma méthode de coloration.

Donc je vous mets une image avec z^1.5 + c :

Spoiler:

Je vais essayer z^z
Revenir en haut Aller en bas
http://www.unilim.fr/pages_perso/jean.debord/index.htm
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 1:29

Minibug a écrit:
Merci Papydall pour toutes ces belles choses que tu nous proposes.  

Cela parait tellement simple lorsque c'est toi qui les programme !  

Merci bien Minibug.


jean_debord a écrit:
Je n'obtiens pas d'images très esthétiques avec la fonction en exp/tan/sin. C'est sans doute dû à ma méthode de coloration.

Il faut aussi bien choisir la région de l’image à explorer.
Pour cela, rien ne vaut les essais par … tâtonnement et un peu de réflexion !

Je vous propose l’image de sin(z)

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 25/09/2018
rem ============================================================================
rem                   sin(z) + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem Rappel mathématique:
rem sin(z) = sin(x+yi) = sin(x)*cos(yi) + cos(x)*sin(yi)
rem        = sin(x)*hcos(y) + (cos(x)*hsin(y))i
rem ============================================================================
rem Appel : SinusZ(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
SinusZ(-4.6776,4.6776,-3.5,3.5,0,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,10 : left 20,10 : font_bold 20 : font_size 20,14
    font_color 20,0,0,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' La fonction sin(z) présente une symétrie horizontale, il suffit de balayer l’écran
' de 0 à ilimit/2 et de tracer deux points (j,i) et (j,ilimit-i) pour un même calcul
' De cette façon on réduit le temps du tracé de la moitié.

SUB SinusZ(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$,t$
    if imag >= 0 then s$ = "+"
    t$ = "SIN(Z) + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i" + chr$(13)
    t$ = t$ + "xmin = " + str$(xmin) + " ; xmax = "+ str$(xmax) + " ; ymin = " + str$(ymin) + " ; ymax = " + str$(ymax)
    caption 20,t$
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                xx = sin(x)*hcos(y) + real : ' calcul de ...
                yy = cos(x)*hsin(y) + imag : ' ... sin(z)                      
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Cliquez !:


Dernière édition par papydall le Mer 26 Sep 2018 - 2:05, édité 1 fois
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 1:53

J’ai trouvé dans mes archives un code montrant comment coder z3 d'une autre façon.

Code:

rem ============================================================================
rem                 Biomorphes de PICKOVER
rem                  Papydall - Juin 2017
rem ============================================================================
rem Les biomorphes sont issus d’un programme informatique.
rem L’algorithme permettant de tracer un biomorphe utilise les nombres complexes.
rem Il manipule une suite de complexes dans le plan complexe.
rem ============================================================================
rem RAPPEL :
rem Un nombre complexe n’est pas si complexe que ça !
rem Il s’appelle complexe parce qu’il est composé de deux parties :
rem L’une dite partie réelle et l’autre partie imaginaire.
rem Un nombre complexe z s’écrit sous la forme :
rem         ______________
rem        |              |
rem        | z = a + i*b  |
rem        |______________|
rem
rem Dans le plan complexe, z désigne l’affixe d’un point où la partie réelle a
rem en détermine l’abscisse et la partie imaginaire b, l’ordonnée.
rem ============================================================================
rem Le nombre i (qui s’appelle unité imaginaire) est tel que i² = -1
rem C’est-à-dire "i = racine carrée de moins un"
rem ============================================================================
rem Comme exemple, on s’intéresse au biomorphe appelé "radiolaire" à 12 branches
rem de la forme z³ + c

rem ============================================================================
dim xc,yc : xc = 0.5 : yc = 0.1 : ' c <--- xc + i*yc
dim rz,rza,iz,iza,j,k,n,xm,ym,t$
width 0,750
picture 10 : width 10,width_client(0)-100 : height 10,height_client(0)-100
top 10,50 : left 10,50 : 2d_target_is 10  : color 10,0,0,0
alpha 20 : font_size 20,14 : font_bold 20 : font_color 20,0,0,255 : left 20,150
t$ = "Biomorphe de Pickover : Radiolaire à 12 branches" + chr$(13)
t$ = t$ + "de la forme z³ + c  ..... <ESC> pour arrêter ....."
caption 20,t$ : caption 0,"Tracé en cours ..."
xm = width(10) : ym = height(10)
for j = 50 to xm - 50
    for k = 10 to ym
        rza = -6.4 + 0.02 * j : iza = -3.5 + 0.02 * k
        for n = 1 to 10
            rz = power(rza,3) - 3 * rza * power(iza,2) + xc : ' partie réelle de z
            iz = 3 * power(rza,2) * iza - power(iza,3) + yc : ' partie imaginaire de z
            IF (ABS(rz) > 10) OR (ABS(iz) > 10) OR (SQR(rz*rz+iz*iz) > 10) THEN exit_for
            rza = rz : iza = iz
        next n
        IF (ABS(rz) < 10) OR (ABS(iz) < 10)
           2d_pen_color 255,0,0 : 2d_point j,k
        end_if
        IF (ABS(rz) <  OR (ABS(iz) <
           2d_pen_color 255,255,0 : 2d_point j,k
        end_if
        IF (ABS(rz) < 6) OR (ABS(iz) < 6)
           2d_pen_color 0,255,0 : 2d_point j,k
        end_if
        IF (ABS(rz) < 4) OR (ABS(iz) < 4)
           2d_pen_color 255,0,0 : 2d_point j,k
        end_if
        IF (ABS(rz) < 2) OR (ABS(iz) < 2)
           2d_pen_color 255,255,0 : 2d_point j,k
        end_if
        display
        if scancode = 27 then terminate
    NEXT k
NEXT j
caption 0,"Terminé"
rem ============================================================================


Résultat:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 2:47

Cosinus Z

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 26/09/2018
rem ============================================================================
rem                   cos(z) + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem Rappel mathématique:
rem cos(z) = cos(x) * hcos(y) - (sin(x) * hsin(y))i
rem ============================================================================
rem Appel : CosinusZ(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
CosinusZ(-4.6776,4.6776,-3.5,3.5,0,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = h*4/3 : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,10 : left 20,10 : font_bold 20 : font_size 20,14
    font_color 20,0,0,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================
' La fonction cos(z) présente une symétrie horizontale, il suffit de balayer l’écran
' de 0 à ilimit/2 et de tracer deux points (j,i) et (j,ilimit-i) pour un même calcul
' De cette façon on réduit le temps du tracé de la moitié.

SUB CosinusZ(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$,t$
    if imag >= 0 then s$ = "+"
    t$ = "COS(Z) + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i" + chr$(13)
    t$ = t$ + "xmin = " + str$(xmin) + " ; xmax = "+ str$(xmax) + " ; ymin = " + str$(ymin) + " ; ymax = " + str$(ymax)
    caption 20,t$
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                xx = cos(x)*hcos(y) + real : ' calcul de ...
                yy = 0-sin(x)*hsin(y) + imag : ' ... Cos(z)                
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  : display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Résultat:


Dernière édition par papydall le Mer 26 Sep 2018 - 3:33, édité 1 fois
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 3:32

Cosinus Hyperbolique de Z

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 26/09/2018
rem ============================================================================
rem                   hcos(z) + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem Rappel mathématique:
rem hcos(z) = hcos(x) * cos(y) + (hsin(x) * sin(y))i
rem ============================================================================
rem Appel : CosinusHyperboliqueZ(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
CosinusHyperboliqueZ(-4.6776,4.6776,-3.5,3.5,0,0)
' CosinusHyperboliqueZ(-4.6776,4.6776,-3.5,3.5,0.1,0)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = int(h*4/3) : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,10 : left 20,10 : font_bold 20 : font_size 20,14
    font_color 20,0,0,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================

SUB CosinusHyperboliqueZ(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$,t$
    if imag >= 0 then s$ = "+"
    t$ = "HCOS(Z) + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i" + chr$(13)
    t$ = t$ + "xmin = " + str$(xmin) + " ; xmax = "+ str$(xmax) + " ; ymin = " + str$(ymin) + " ; ymax = " + str$(ymax)
    caption 20,t$
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit/2
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                xx = hcos(x)*cos(y) + real : ' calcul de ...
                yy = hsin(x)*sin(y) + imag : ' ... HCos(z)                
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  
            2d_point jlimit-j,i : 2d_point jlimit-j,ilimit-i
             display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Spoiler:

Une légère modification de C:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 4:20

Sinus Hyperbolique de Z

Code:

rem ============================================================================
rem                    Biomorphe de Pickover
rem                     Papydall 26/09/2018
rem ============================================================================
rem                   hsin(z) + Constante Complexe
rem           Constante complexe : C = real + (imag)i
rem ============================================================================
rem Rappel mathématique:
rem hsin(z) = hsin(x) * cos(y) + hcos(x) * sin(y)
rem ============================================================================
rem Appel : SinusHyperboliqueZ(xmin,xmax,ymin,ymax,real,imag)  
rem ============================================================================

Init()
SinusHyperboliqueZ(-4.6776,4.6776,-3.5,3.5,0,0)
' SinusHyperboliqueZ(-4.6776,4.6776,-3.5,3.5,0.5,0.01)

end
rem ============================================================================
SUB Init()
    dim h,w  : h = 350 : w = int(h*4/3) : ' Taille de l'image
    dim x,y,xx,yy
    picture 10 : width 10,w : height 10,h : 2d_target_is 10
    top 10, (height_client(0) - height(10))/2 + 20
    left 10,(width_client(0) - width(10))/2
    alpha 20 : top 20,10 : left 20,10 : font_bold 20 : font_size 20,14
    font_color 20,0,0,250 : font_name 20,"tahoma"
END_SUB
rem ============================================================================

SUB SinusHyperboliqueZ(xmin,xmax,ymin,ymax,real,imag)
    dim_local ilimit : ilimit = h-1
    dim_local jlimit : jlimit = w-1
    dim_local x0,y0,i,j,n,s$,t$
    if imag >= 0 then s$ = "+"
    t$ = "HSIN(Z) + C avec C = " + str$(real) + " " + s$ + " " + str$(imag) +" i" + chr$(13)
    t$ = t$ + "xmin = " + str$(xmin) + " ; xmax = "+ str$(xmax) + " ; ymin = " + str$(ymin) + " ; ymax = " + str$(ymax)
    caption 20,t$
    caption 0, "Biomorphe de Pickover ... Tracé en cours ... <ESC> pour arrêter ..."
    FOR i = 0 TO ilimit/2
        FOR j = 0 TO jlimit/2
            x0 = xmin + (xmax - xmin) * j / jlimit
            y0 = -1*ymin - (ymax - ymin) * i / ilimit
            x = x0 : y = y0
            FOR n = 1 TO 100
                xx = hsin(x)*cos(y) + real : ' calcul de ...
                yy = hcos(x)*sin(y) + imag : ' ... Hsin(z)                
                x = xx : y = yy
                IF (ABS(x) > 10) OR (ABS(y) > 10) or ((x*x + y*y) > 100)  THEN exit_for        
            NEXT n
            IF (ABS(x) > 10) and (ABS(y) > 10)
               2d_pen_color 0,0,0
            else
               if (abs(x) > 10) and (abs(y) <= 10)
                  2d_pen_color 255,0,0
               else
                  if (abs(x) <= 10) and (abs(y) > 10)
                     2d_pen_color 0,255,0
                  else
                     2d_pen_color 255,255,0
                  end_if
               end_if
            end_if      
            2d_point j, i : 2d_point j,ilimit - i  
            2d_point jlimit-j,i : 2d_point jlimit-j,ilimit-i
             display
            if scancode = 27 then terminate
        NEXT j
    NEXT i
    caption 0,"Terminé"
END_SUB
rem ============================================================================


Spoiler:

Spoiler:


Bon, moi j'arrête.
Je vous laisser expérimenter ce vaste domaine par vous-même tongue
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 6:53

Bonus

Code:

rem ============================================================================
rem           Biomorphe
rem       Papydall 26/09/2018
rem ============================================================================
dim xc : xc = 0.5
dim yc : yc = 0.1
dim j,k,n,rz0,iz0,rz,iz
dim w,h
w = 400 : h = 400
picture 10 : width 10,w : height 10,h : 2d_target_is 10 : color 10,0,0,0
top 10,(height_client(0) - height_client(10))/2
left 10, (width_client(0) - width_client(10))/2
caption 0,"Tracé en cours ... <ESC> pour arrêter ..."
for j = 1 to w
    for k = 1 to h/2
        rz0 = -10+0.05*j : iz0 = -10+0.05*k
        for n = 1 to 10
            rz = sin(rz0)/2*(exp(0-iz0) + exp(iz0)) + rz0*rz0 - iz0*iz0 + xc
            iz = 0-cos(rz0)/2*(exp(0-iz0) - exp(iz0)) + 2*rz0*rz0*iz0 +yc
            IF (ABS(Rz) > 10) OR (ABS(Iz) > 10) OR (SQR(Rz*rz+Iz*iz) > 10) THEN exit_for
            rz0 = rz : iz0 = iz
        next n
        IF (ABS(Rz) < 10) OR (ABS(Iz) < 10)
           IF (ABS(rz) < 10) OR (ABS(iz) < 10) then 2d_pen_color 255,000,000
           IF (ABS(rz) < 08) OR (ABS(iz) < 08) then 2d_pen_color 255,255,000  
           IF (ABS(rz) < 06) OR (ABS(iz) < 06) then 2d_pen_color 000,255,000  
           IF (ABS(rz) < 04) OR (ABS(iz) < 04) then 2d_pen_color 255,000,000
           IF (ABS(rz) < 02) OR (ABS(iz) < 02) then 2d_pen_color 255,255,000
           2d_point j,k : 2d_point j,h-k : display
        end_if
        if scancode = 27 then terminate
    next k
next j
caption 0,"Terminé"
rem ============================================================================


Spoiler:
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
silverman

silverman


Nombre de messages : 968
Age : 51
Localisation : Picardie
Date d'inscription : 18/03/2015

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyMer 26 Sep 2018 - 13:34

Le bonus traduit en FreeBASIC: Very Happy
Code:
'
'    rem ============================================================================
'    rem           Biomorphe
'    rem       Papydall 26/09/2018
'    rem ============================================================================
'    dim xc : xc = 0.5
'    dim yc : yc = 0.1
'    dim j,k,n,rz0,iz0,rz,iz
'    dim w,h
'    w = 400 : h = 400
'    picture 10 : width 10,w : height 10,h : 2d_target_is 10 : color 10,0,0,0
'    top 10,(height_client(0) - height_client(10))/2
'    left 10, (width_client(0) - width_client(10))/2
'    caption 0,"Tracé en cours ... <ESC> pour arrêter ..."
'    for j = 1 to w
'        for k = 1 to h/2
'            rz0 = -10+0.05*j : iz0 = -10+0.05*k
'            for n = 1 to 10
'                rz = sin(rz0)/2*(exp(0-iz0) + exp(iz0)) + rz0*rz0 - iz0*iz0 + xc
'                iz = 0-cos(rz0)/2*(exp(0-iz0) - exp(iz0)) + 2*rz0*rz0*iz0 +yc
'                IF (ABS(Rz) > 10) OR (ABS(Iz) > 10) OR (SQR(Rz*rz+Iz*iz) > 10) THEN exit_for
'                rz0 = rz : iz0 = iz
'            next n
'            IF (ABS(Rz) < 10) OR (ABS(Iz) < 10)
'               IF (ABS(rz) < 10) OR (ABS(iz) < 10) then 2d_pen_color 255,000,000
'               IF (ABS(rz) < 08) OR (ABS(iz) < 08) then 2d_pen_color 255,255,000  
'               IF (ABS(rz) < 06) OR (ABS(iz) < 06) then 2d_pen_color 000,255,000  
'               IF (ABS(rz) < 04) OR (ABS(iz) < 04) then 2d_pen_color 255,000,000
'               IF (ABS(rz) < 02) OR (ABS(iz) < 02) then 2d_pen_color 255,255,000
'               2d_point j,k : 2d_point j,h-k : display
'            end_if
'            if scancode = 27 then terminate
'        next k
'    next j
'    caption 0,"Terminé"
'    rem ============================================================================
'

' FreeBASIC Version 1.04.0
' Optionnel : pour ne pas afficher la console avec l'éditeur FBide, allez dans : Voir>Paramètres>FreeBASIC, et placer dans "ligne de commande du compilateur" :
' "<$fbc>" -s gui "<$file>"
    dim as single xc=0.5
    dim as single yc=0.5
    dim as single j,k,n,rz0,iz0,rz,iz
    dim as ulong w,h
    dim as ulong couleur
    w = 400 : h = 400
    ScreenRes w , h, 32
    WindowTitle "Tracé en cours ... <ESC> pour arrêter ..."
    screenlock()
    for j = 1 to w
        for k = 1 to h/2
            rz0 = -10+0.05*j : iz0 = -10+0.05*k
            for n = 1 to 10
                rz = sin(rz0)/2*(exp(0-iz0) + exp(iz0)) + rz0*rz0 - iz0*iz0 + xc
                iz = 0-cos(rz0)/2*(exp(0-iz0) - exp(iz0)) + 2*rz0*rz0*iz0 +yc
                IF (ABS(Rz) > 10) OR (ABS(Iz) > 10) OR (SQR(Rz*rz+Iz*iz) > 10) THEN exit for
                rz0 = rz : iz0 = iz
            next n
            IF (ABS(Rz) < 10) OR (ABS(Iz) < 10) then
               IF (ABS(rz) < 10) OR (ABS(iz) < 10) then couleur=rgb(255,0,0)
               IF (ABS(rz) < 08) OR (ABS(iz) < 08) then couleur=rgb(255,255,0)  
               IF (ABS(rz) < 06) OR (ABS(iz) < 06) then couleur=rgb(0,255,0)  
               IF (ABS(rz) < 04) OR (ABS(iz) < 04) then couleur=rgb(255,0,0)
               IF (ABS(rz) < 02) OR (ABS(iz) < 02) then couleur=rgb(255,255,0)
               pset(j,k),couleur : pset(j,h-k),couleur
            end if
            if inkey = chr(27) then end
        next k
    next j
    screenunlock()
    WindowTitle "Terminé"
    sleep
    

L'affichage est instantané cheers cheers cheers
Revenir en haut Aller en bas
jean_debord

jean_debord


Nombre de messages : 1250
Age : 69
Localisation : Limoges
Date d'inscription : 21/09/2008

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptyVen 28 Sep 2018 - 9:07

Voici quelques exemples avec la fonction exponentielle complexe :

Tout d'abord, une vue d'ensemble pour montrer la périodicité de la fonction sur l'axe vertical :

Spoiler:

Puis un agrandissement de la zone centrale :

Spoiler:

Enfin, un agrandissement dans la zone précédente :

Spoiler:
Revenir en haut Aller en bas
http://www.unilim.fr/pages_perso/jean.debord/index.htm
jean_debord

jean_debord


Nombre de messages : 1250
Age : 69
Localisation : Limoges
Date d'inscription : 21/09/2008

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptySam 29 Sep 2018 - 9:08

Autre exemple avec la fonction sinus :

Spoiler:

Ici, un agrandissement dans l'ensemble de Mandelbrot pour la fonction sin(z) + c : on y retrouve des mini-ensembles de forme classique :

Spoiler:
Revenir en haut Aller en bas
http://www.unilim.fr/pages_perso/jean.debord/index.htm
papydall

papydall


Nombre de messages : 7006
Age : 73
Localisation : Moknine (Tunisie) Entre la chaise et le clavier
Date d'inscription : 03/03/2012

Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover EmptySam 29 Sep 2018 - 19:49

C'est très beau tout ça.
Merci Jean.
Revenir en haut Aller en bas
http://papydall-panoramic.forumarabia.com/
Contenu sponsorisé





Biomorphe de Pickover Empty
MessageSujet: Re: Biomorphe de Pickover   Biomorphe de Pickover Empty

Revenir en haut Aller en bas
 
Biomorphe de Pickover
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Biomorphes de Pickover

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: