@@ -76,7 +76,7 @@ const VIEW_PRESETS = {
7676 lichtenberg_figures : { centerX : 0.0 , centerY : 0.0 , span : 3.8 } ,
7777 koch : { centerX : 0.45 , centerY : - 0.28 , span : 0.9 } ,
7878 dragon_heighway : { centerX : 0.2 , centerY : 0.0 , span : 2.8 } ,
79- dragon_curve : { centerX : 0.2 , centerY : 0.0 , span : 2.8 } ,
79+ gosper_curve : { centerX : 0.15 , centerY : 0.05 , span : 3.2 } ,
8080 cantor_set : { centerX : 0.0 , centerY : 0.0 , span : 2.6 } ,
8181 triangle_de_cercles_recursifs : { centerX : 0.0 , centerY : 0.05 , span : 2.4 } ,
8282 apollonian_gasket : { centerX : 0.0 , centerY : 0.0 , span : 2.2 } ,
@@ -104,7 +104,7 @@ function getMultibrotPreset(power) {
104104}
105105
106106const POINT_FRACTALS = new Set ( [ "barnsley" , "sierpinski" , "tapis_sierpinski" , "menger_sponge" , "mandelbulb" , "tetraedre_sierpinski" , "julia_quaternion" , "mandelbox" , "vicsek_fractal" , "lichtenberg_figures" , "attracteur_de_clifford" , "attracteur_de_peter_de_jong" , "attracteur_ikeda" , "attracteur_de_henon" , "lorenz_attractor" , "feigenbaum_tree" ] ) ;
107- const LINE_FRACTALS = new Set ( [ "koch" , "dragon_heighway" , "dragon_curve " , "cantor_set" , "triangle_de_cercles_recursifs" , "apollonian_gasket" , "t_square_fractal" , "h_fractal" , "hilbert_curve" , "peano_curve" , "arbre_pythagore" ] ) ;
107+ const LINE_FRACTALS = new Set ( [ "koch" , "dragon_heighway" , "gosper_curve " , "cantor_set" , "triangle_de_cercles_recursifs" , "apollonian_gasket" , "t_square_fractal" , "h_fractal" , "hilbert_curve" , "peano_curve" , "arbre_pythagore" ] ) ;
108108
109109/** Fonctions fractales exportées par WASM */
110110// Les fractales 3D en JS pur (julia_quaternion, mandelbox) sont toujours disponibles.
@@ -322,7 +322,7 @@ const FRACTAL_FAMILIES = [
322322 fractales : [
323323 [ "koch" , "Koch" ] ,
324324 [ "dragon_heighway" , "Dragon de Heighway" ] ,
325- [ "dragon_curve " , "Courbe du dragon " ] ,
325+ [ "gosper_curve " , "Courbe de Gosper " ] ,
326326 [ "cantor_set" , "Ensemble de Cantor" ] ,
327327 [ "triangle_de_cercles_recursifs" , "Triangle de cercles récursifs" ] ,
328328 [ "apollonian_gasket" , "Joint apollonien" ] ,
@@ -1104,6 +1104,20 @@ function genererDragonHeighway(iterations) {
11041104 return s ;
11051105}
11061106
1107+ function genererGosper ( iterations ) {
1108+ let s = "A" ;
1109+ for ( let i = 0 ; i < iterations ; i ++ ) {
1110+ let next = "" ;
1111+ for ( const ch of s ) {
1112+ if ( ch === "A" ) next += "A-B--B+A++AA+B-" ;
1113+ else if ( ch === "B" ) next += "+A-BB--B-A++A+B" ;
1114+ else next += ch ;
1115+ }
1116+ s = next ;
1117+ }
1118+ return s . replace ( / [ A B ] / g, "F" ) ;
1119+ }
1120+
11071121function genererHilbert ( iterations ) {
11081122 let s = "A" ;
11091123 for ( let i = 0 ; i < iterations ; i ++ ) {
@@ -1526,10 +1540,14 @@ function dessinerFractaleLineaire(ctxCible, w, h, vueCible, renduParams) {
15261540 const n = Math . max ( 0 , Math . min ( 6 , Math . floor ( ( renduParams . maxIter - 64 ) / 128 ) ) ) ;
15271541 const commands = kochGenerate ( n ) ;
15281542 dessinerCommandeLineaireMonde ( traceur , commands , 0.05 , - 0.28 , 0.0 , 0.8 / Math . pow ( 3 , n ) , Math . PI / 3 ) ;
1529- } else if ( renduParams . fractal === "dragon_heighway" || renduParams . fractal === "dragon_curve" ) {
1543+ } else if ( renduParams . fractal === "dragon_heighway" ) {
15301544 const n = Math . max ( 8 , Math . min ( 15 , Math . floor ( renduParams . maxIter / 64 ) + 7 ) ) ;
15311545 const commands = genererDragonHeighway ( n ) ;
15321546 dessinerCommandeLineaireMonde ( traceur , commands , - 0.6 , 0.0 , 0.0 , 1.7 / Math . pow ( Math . SQRT2 , n ) , Math . PI / 2 ) ;
1547+ } else if ( renduParams . fractal === "gosper_curve" ) {
1548+ const n = Math . max ( 1 , Math . min ( 4 , Math . floor ( renduParams . maxIter / 112 ) + 1 ) ) ;
1549+ const commands = genererGosper ( n ) ;
1550+ dessinerCommandeLineaireMonde ( traceur , commands , - 0.95 , 0.35 , 0.0 , 2.2 / Math . pow ( Math . sqrt ( 7 ) , n ) , Math . PI / 3 ) ;
15331551 } else if ( renduParams . fractal === "cantor_set" ) {
15341552 dessinerCantorMonde ( traceur , renduParams . maxIter ) ;
15351553 } else if ( renduParams . fractal === "triangle_de_cercles_recursifs" ) {
@@ -1887,7 +1905,7 @@ async function loadWasm() {
18871905 mandelbox : typeof exports . mandelbox === "function" ? exports . mandelbox : mandelboxJS ,
18881906 koch : typeof exports . koch === "function" ? exports . koch : null ,
18891907 dragon_heighway : typeof exports . dragon_heighway === "function" ? exports . dragon_heighway : null ,
1890- dragon_curve : typeof exports . dragon_curve === "function" ? exports . dragon_curve : null ,
1908+ gosper_curve : typeof exports . gosper_curve === "function" ? exports . gosper_curve : null ,
18911909 cantor_set : typeof exports . cantor_set === "function" ? exports . cantor_set : null ,
18921910 triangle_de_cercles_recursifs : typeof exports . triangle_de_cercles_recursifs === "function" ? exports . triangle_de_cercles_recursifs : null ,
18931911 apollonian_gasket : typeof exports . apollonian_gasket === "function" ? exports . apollonian_gasket : null ,
@@ -2636,7 +2654,7 @@ const FRACTAL_SOURCE_MAP = {
26362654 lichtenberg_figures : "fractales_ifs" ,
26372655 koch : "fractales_lsystem" ,
26382656 dragon_heighway : "fractales_lsystem" ,
2639- dragon_curve : "fractales_lsystem" ,
2657+ gosper_curve : "fractales_lsystem" ,
26402658 cantor_set : "fractales_lsystem" ,
26412659 triangle_de_cercles_recursifs : "fractales_lsystem" ,
26422660 apollonian_gasket : "fractales_lsystem" ,
@@ -2757,7 +2775,7 @@ function highlightFrench(code) {
27572775function applyFrenchTokens ( line , kwRe ) {
27582776 return line
27592777 . replace ( kwRe , `<span class="kw">$1</span>` )
2760- . replace ( / \b ( m a n d e l b r o t | m a n d e l b r o t _ c l a s s e | j u l i a | b u r n i n g _ s h i p | t r i c o r n | m u l t i b r o t | c e l t i c | b u f f a l o | p e r p e n d i c u l a r _ b u r n i n g _ s h i p | h e a r t | p e r p e n d i c u l a r _ m a n d e l b r o t | p e r p e n d i c u l a r _ c e l t i c | d u c k | b u d d h a b r o t | n e w t o n | p h o e n i x | l y a p u n o v | l y a p u n o v _ m u l t i s e q u e n c e | b a s s i n _ n e w t o n _ g e n e r a l i s e | o r b i t a l e _ d e _ n o v a | c o l l a t z _ c o m p l e x e | a t t r a c t e u r _ d e _ c l i f f o r d | a t t r a c t e u r _ d e _ p e t e r _ d e _ j o n g | a t t r a c t e u r _ i k e d a | a t t r a c t e u r _ d e _ h e n o n | l o r e n z _ a t t r a c t o r | f e i g e n b a u m _ t r e e | b a r n s l e y | s i e r p i n s k i | t a p i s _ s i e r p i n s k i | m e n g e r _ s p o n g e | m a n d e l b u l b | v i c s e k _ f r a c t a l | l i c h t e n b e r g _ f i g u r e s | k o c h | d r a g o n _ h e i g h w a y | d r a g o n _ c u r v e | c a n t o r _ s e t | t r i a n g l e _ d e _ c e r c l e s _ r e c u r s i f s | a p o l l o n i a n _ g a s k e t | t _ s q u a r e _ f r a c t a l | h _ f r a c t a l | h i l b e r t _ c u r v e | p e a n o _ c u r v e | a r b r e _ p y t h a g o r e | m a g n e t 1 | m a g n e t 2 | m a g n e t 3 | l a m b d a _ f r a c t a l e | l a m b d a _ c u b i q u e | m a g n e t _ c o s i n u s | m a g n e t _ s i n u s | n o v a _ m a g n e t i q u e | b a r n s l e y _ e t a p e | s i e r p i n s k i _ e t a p e | m e n g e r _ e t a p e | v i c s e k _ e t a p e | p r o j e t e r _ m e n g e r _ x | p r o j e t e r _ m e n g e r _ y | p r o j e t e r _ l o r e n z _ x | p r o j e t e r _ l o r e n z _ y | e t a p e T a p i s S i e r p i n s k i | e t a p e A t t r a c t e u r C l i f f o r d | e t a p e A t t r a c t e u r P e t e r D e J o n g | e t a p e A t t r a c t e u r I k e d a | e t a p e A t t r a c t e u r H e n o n | e t a p e L o r e n z A t t r a c t o r | e t a p e M e n g e r S p o n g e | e t a p e V i c s e k F r a c t a l | e t a p e L i c h t e n b e r g | e t a p e M a n d e l b u l b | p r o j e t e r M e n g e r S p o n g e | p r o j e t e r L o r e n z A t t r a c t o r | p r o j e t e r M a n d e l b u l b | k o c h _ g e n e r e r | g e n e r e r D r a g o n H e i g h w a y | g e n e r e r H i l b e r t | g e n e r e r P e a n o | n o r m e _ c a r r e | c o m p l e x e _ d i v i s e r _ r e | c o m p l e x e _ d i v i s e r _ i m | i t e r e r | e t a p e | r a c i n e _ a p p r o x | a b s _ v a l | a b s _ d y n a m i q u e | a b s _ k o c h | r e m p l a c e r | r e g l e | g e n e r e r | s i n u s _ d y n a m i q u e | c o s i n u s _ d y n a m i q u e | s i n u s _ m a g n e t i q u e | c o s i n u s _ m a g n e t i q u e ) \b / g, `<span class="fn">$1</span>` )
2778+ . replace ( / \b ( m a n d e l b r o t | m a n d e l b r o t _ c l a s s e | j u l i a | b u r n i n g _ s h i p | t r i c o r n | m u l t i b r o t | c e l t i c | b u f f a l o | p e r p e n d i c u l a r _ b u r n i n g _ s h i p | h e a r t | p e r p e n d i c u l a r _ m a n d e l b r o t | p e r p e n d i c u l a r _ c e l t i c | d u c k | b u d d h a b r o t | n e w t o n | p h o e n i x | l y a p u n o v | l y a p u n o v _ m u l t i s e q u e n c e | b a s s i n _ n e w t o n _ g e n e r a l i s e | o r b i t a l e _ d e _ n o v a | c o l l a t z _ c o m p l e x e | a t t r a c t e u r _ d e _ c l i f f o r d | a t t r a c t e u r _ d e _ p e t e r _ d e _ j o n g | a t t r a c t e u r _ i k e d a | a t t r a c t e u r _ d e _ h e n o n | l o r e n z _ a t t r a c t o r | f e i g e n b a u m _ t r e e | b a r n s l e y | s i e r p i n s k i | t a p i s _ s i e r p i n s k i | m e n g e r _ s p o n g e | m a n d e l b u l b | v i c s e k _ f r a c t a l | l i c h t e n b e r g _ f i g u r e s | k o c h | d r a g o n _ h e i g h w a y | g o s p e r _ c u r v e | c a n t o r _ s e t | t r i a n g l e _ d e _ c e r c l e s _ r e c u r s i f s | a p o l l o n i a n _ g a s k e t | t _ s q u a r e _ f r a c t a l | h _ f r a c t a l | h i l b e r t _ c u r v e | p e a n o _ c u r v e | a r b r e _ p y t h a g o r e | m a g n e t 1 | m a g n e t 2 | m a g n e t 3 | l a m b d a _ f r a c t a l e | l a m b d a _ c u b i q u e | m a g n e t _ c o s i n u s | m a g n e t _ s i n u s | n o v a _ m a g n e t i q u e | b a r n s l e y _ e t a p e | s i e r p i n s k i _ e t a p e | m e n g e r _ e t a p e | v i c s e k _ e t a p e | p r o j e t e r _ m e n g e r _ x | p r o j e t e r _ m e n g e r _ y | p r o j e t e r _ l o r e n z _ x | p r o j e t e r _ l o r e n z _ y | e t a p e T a p i s S i e r p i n s k i | e t a p e A t t r a c t e u r C l i f f o r d | e t a p e A t t r a c t e u r P e t e r D e J o n g | e t a p e A t t r a c t e u r I k e d a | e t a p e A t t r a c t e u r H e n o n | e t a p e L o r e n z A t t r a c t o r | e t a p e M e n g e r S p o n g e | e t a p e V i c s e k F r a c t a l | e t a p e L i c h t e n b e r g | e t a p e M a n d e l b u l b | p r o j e t e r M e n g e r S p o n g e | p r o j e t e r L o r e n z A t t r a c t o r | p r o j e t e r M a n d e l b u l b | k o c h _ g e n e r e r | g e n e r e r D r a g o n H e i g h w a y | g e n e r e r G o s p e r | g e n e r e r H i l b e r t | g e n e r e r P e a n o | n o r m e _ c a r r e | c o m p l e x e _ d i v i s e r _ r e | c o m p l e x e _ d i v i s e r _ i m | i t e r e r | e t a p e | r a c i n e _ a p p r o x | a b s _ v a l | a b s _ d y n a m i q u e | a b s _ k o c h | r e m p l a c e r | r e g l e | g e n e r e r | s i n u s _ d y n a m i q u e | c o s i n u s _ d y n a m i q u e | s i n u s _ m a g n e t i q u e | c o s i n u s _ m a g n e t i q u e ) \b / g, `<span class="fn">$1</span>` )
27612779 . replace ( / \b ( \d + \. \d + | \d + ) \b / g, `<span class="num">$1</span>` )
27622780 . replace ( / \b ( c x | c y | z x | z y | c _ r e | c _ i m | m a x _ i t e r | x | y | i t e r | x t e m p | a x | a y | x 2 | y 2 | f x | f y | d f x | d f y | d e n o m | d e l t a _ x | d e l t a _ y | x _ p r e c | y _ p r e c | x t e m p | y t e m p | d 1 | d 2 | d 3 | d 4 | p u i s s a n c e | r n | a n g l e | r | t h e t a | n x | n y | a | b | n i v e a u | e c h e l l e | d i s t | s c o r e | s o m m e | e x p o s a n t | p a r a m e t r e ) \b / g, `<span class="param">$1</span>` ) ;
27632781}
@@ -2780,7 +2798,7 @@ function highlightPython(code) {
27802798function applyPyTokens ( line , kwRe ) {
27812799 return line
27822800 . replace ( kwRe , `<span class="kw">$1</span>` )
2783- . replace ( / \b ( m a n d e l b r o t | m a n d e l b r o t _ c l a s s e | j u l i a | b u r n i n g _ s h i p | t r i c o r n | m u l t i b r o t | c e l t i c | b u f f a l o | p e r p e n d i c u l a r _ b u r n i n g _ s h i p | h e a r t | p e r p e n d i c u l a r _ m a n d e l b r o t | p e r p e n d i c u l a r _ c e l t i c | d u c k | b u d d h a b r o t | n e w t o n | p h o e n i x | l y a p u n o v | l y a p u n o v _ m u l t i s e q u e n c e | b a s s i n _ n e w t o n _ g e n e r a l i s e | o r b i t a l e _ d e _ n o v a | c o l l a t z _ c o m p l e x e | a t t r a c t e u r _ d e _ c l i f f o r d | a t t r a c t e u r _ d e _ p e t e r _ d e _ j o n g | a t t r a c t e u r _ i k e d a | a t t r a c t e u r _ d e _ h e n o n | l o r e n z _ a t t r a c t o r | f e i g e n b a u m _ t r e e | b a r n s l e y | s i e r p i n s k i | t a p i s _ s i e r p i n s k i | m e n g e r _ s p o n g e | m a n d e l b u l b | v i c s e k _ f r a c t a l | l i c h t e n b e r g _ f i g u r e s | k o c h | d r a g o n _ h e i g h w a y | d r a g o n _ c u r v e | c a n t o r _ s e t | t r i a n g l e _ d e _ c e r c l e s _ r e c u r s i f s | a p o l l o n i a n _ g a s k e t | t _ s q u a r e _ f r a c t a l | h _ f r a c t a l | h i l b e r t _ c u r v e | p e a n o _ c u r v e | a r b r e _ p y t h a g o r e | m a g n e t 1 | m a g n e t 2 | m a g n e t 3 | l a m b d a _ f r a c t a l e | l a m b d a _ c u b i q u e | m a g n e t _ c o s i n u s | m a g n e t _ s i n u s | n o v a _ m a g n e t i q u e | b a r n s l e y _ e t a p e | s i e r p i n s k i _ e t a p e | m e n g e r _ e t a p e | v i c s e k _ e t a p e | p r o j e t e r _ m e n g e r _ x | p r o j e t e r _ m e n g e r _ y | p r o j e t e r _ l o r e n z _ x | p r o j e t e r _ l o r e n z _ y | k o c h _ g e n e r e r | g e n e r e r D r a g o n H e i g h w a y | g e n e r e r H i l b e r t | g e n e r e r P e a n o | n o r m e _ c a r r e | c o m p l e x e _ d i v i s e r _ r e | c o m p l e x e _ d i v i s e r _ i m | i t e r e r | e t a p e | r a c i n e _ a p p r o x | a b s _ v a l | r e m p l a c e r | r e g l e | g e n e r e r | s i n u s _ d y n a m i q u e | c o s i n u s _ d y n a m i q u e | s i n u s _ m a g n e t i q u e | c o s i n u s _ m a g n e t i q u e ) \b / g, `<span class="fn">$1</span>` )
2801+ . replace ( / \b ( m a n d e l b r o t | m a n d e l b r o t _ c l a s s e | j u l i a | b u r n i n g _ s h i p | t r i c o r n | m u l t i b r o t | c e l t i c | b u f f a l o | p e r p e n d i c u l a r _ b u r n i n g _ s h i p | h e a r t | p e r p e n d i c u l a r _ m a n d e l b r o t | p e r p e n d i c u l a r _ c e l t i c | d u c k | b u d d h a b r o t | n e w t o n | p h o e n i x | l y a p u n o v | l y a p u n o v _ m u l t i s e q u e n c e | b a s s i n _ n e w t o n _ g e n e r a l i s e | o r b i t a l e _ d e _ n o v a | c o l l a t z _ c o m p l e x e | a t t r a c t e u r _ d e _ c l i f f o r d | a t t r a c t e u r _ d e _ p e t e r _ d e _ j o n g | a t t r a c t e u r _ i k e d a | a t t r a c t e u r _ d e _ h e n o n | l o r e n z _ a t t r a c t o r | f e i g e n b a u m _ t r e e | b a r n s l e y | s i e r p i n s k i | t a p i s _ s i e r p i n s k i | m e n g e r _ s p o n g e | m a n d e l b u l b | v i c s e k _ f r a c t a l | l i c h t e n b e r g _ f i g u r e s | k o c h | d r a g o n _ h e i g h w a y | g o s p e r _ c u r v e | c a n t o r _ s e t | t r i a n g l e _ d e _ c e r c l e s _ r e c u r s i f s | a p o l l o n i a n _ g a s k e t | t _ s q u a r e _ f r a c t a l | h _ f r a c t a l | h i l b e r t _ c u r v e | p e a n o _ c u r v e | a r b r e _ p y t h a g o r e | m a g n e t 1 | m a g n e t 2 | m a g n e t 3 | l a m b d a _ f r a c t a l e | l a m b d a _ c u b i q u e | m a g n e t _ c o s i n u s | m a g n e t _ s i n u s | n o v a _ m a g n e t i q u e | b a r n s l e y _ e t a p e | s i e r p i n s k i _ e t a p e | m e n g e r _ e t a p e | v i c s e k _ e t a p e | p r o j e t e r _ m e n g e r _ x | p r o j e t e r _ m e n g e r _ y | p r o j e t e r _ l o r e n z _ x | p r o j e t e r _ l o r e n z _ y | k o c h _ g e n e r e r | g e n e r e r D r a g o n H e i g h w a y | g e n e r e r G o s p e r | g e n e r e r H i l b e r t | g e n e r e r P e a n o | n o r m e _ c a r r e | c o m p l e x e _ d i v i s e r _ r e | c o m p l e x e _ d i v i s e r _ i m | i t e r e r | e t a p e | r a c i n e _ a p p r o x | a b s _ v a l | r e m p l a c e r | r e g l e | g e n e r e r | s i n u s _ d y n a m i q u e | c o s i n u s _ d y n a m i q u e | s i n u s _ m a g n e t i q u e | c o s i n u s _ m a g n e t i q u e ) \b / g, `<span class="fn">$1</span>` )
27842802 . replace ( / \b ( \d + \. \d + | \d + ) \b / g, `<span class="num">$1</span>` )
27852803 . replace ( / \b ( c x | c y | z x | z y | c _ r e | c _ i m | m a x _ i t e r | x | y | i t e r | x t e m p | a x | a y | x 2 | y 2 | f x | f y | d f x | d f y | d e n o m | d e l t a _ x | d e l t a _ y | x _ p r e c | y _ p r e c | x t e m p | y t e m p | d 1 | d 2 | d 3 | d 4 | p u i s s a n c e | r n | a n g l e | r | t h e t a | n x | n y | a | b | n i v e a u | e c h e l l e | d i s t | s c o r e | s o m m e | e x p o s a n t | p a r a m e t r e ) \b / g, `<span class="param">$1</span>` ) ;
27862804}
0 commit comments