File:Feigenbaum stretch.png

Summary

Description
English: feigenbaum stretch and period doubling cascade. Part of the Mandelbrot set: 12 hyperbolic components period doubling cascade from period 2^0 = 1 to period 2^11 = 2 048. Transform is with which is the Myrberg-Feigenbaum point of family. "With an exponential mapping it is possible to show the self-similarities of these bulbs, and the densification of filaments when zoom depth increases.[1] Created with C program m-streching-feigenbaum.c from mandelbrot-graphics library by Claude Heiland-Allen. See also wikibooks
Date
Source Own work
Author Soul windsurfer
Other versions

P01 - Exponential mapping: Feigenbaum point — Fractalshades 1.2.1 documentation. gbillotey.github.io. Retrieved on 2025-11-27.

C source code

/*

https://fractalforums.org/fractal-image-gallery/18/feigenbaum-stretch/2112
https://fractalforums.org/programming/11/m-streching-feigenbaum-from-mandelbrot-graphics-library-by-claude/3077



m-streching-feigenbaum.c

Transform is c ←e^c+c0 
with c0=−1.401155189092051.


pari error : 

gcc m.c -lm -Wall -fopenmp -lpari $(pkg-config --cflags --libs cairo)
gcc m.c -lm -Wall -fopenmp -lpari -lmpc -lmpfr -lgmp -lm $(pkg-config --cflags --libs cairo)

eror from pari:
gcc m.c -lm -Wall -fopenmp -lpari -lmpc -lmpfr -lgmp -lm $(pkg-config --cflags --libs cairo)
In file included from mandelbrot-numerics.h:8:0,
                 from m.c:9:
/usr/include/x86_64-linux-gnu/pari/paridecl.h:1262:34: error: expected ‘)’ before ‘__extension__’
 GEN     alg_quotient(GEN al, GEN I, int maps);
                                  ^
In file included from /usr/include/x86_64-linux-gnu/pari/pari.h:45:0,
                 from m_binangle.c:3,
                 from m.c:18:
/usr/include/x86_64-linux-gnu/pari/paridecl.h:1262:37: error: expected ‘;’, ‘,’ or ‘)’ before ‘int’
 GEN     alg_quotient(GEN al, GEN I, int maps);
                                     ^~~
In file included from mandelbrot-numerics.h:8:0,







*/


#include "mandelbrot-numerics.h"
#include "mandelbrot-graphics.h"
//#include "mandelbrot-symbolics.h"
#include "m_d_transform.c"
#include "m_d_mat2.c"
#include "m_d_util.h"
#include "m_pixel.c"
#include "m_d_colour.c"
#include "m_d_render_scanline.c"
//#include "m_binangle.c"
#include "m_d_exray_in.c"
#include <stdio.h>

// #include <pari/pari.h>



/*

input
* s_b_angle = binary angle as a string ( for cairo_text_path)
* s_q_angle = the same angle as a decimal rational number ( for m_d_exray_in_new)
*/
void draw_external_ray(m_image *image, m_d_transform *transform, const char *s_b_angle, const char *s_q_angle, m_pixel_t colour, double dx, double dy, int iMax) {
  //int maxiters = 5024;
  double r = sqrt(2);

  // rational angle 
  mpq_t q_angle;
  mpq_init(q_angle);
  mpq_set_str(q_angle, s_q_angle, 10);
  m_d_exray_in *ray = m_d_exray_in_new(q_angle, 8);
  mpq_clear(q_angle);

  cairo_surface_t *surface = m_image_surface(image);
  cairo_t *cr = cairo_create(surface);
  cairo_set_source_rgba(cr, m_pixel_red(colour), m_pixel_green(colour), m_pixel_blue(colour), m_pixel_alpha(colour));
  bool first = true;
  
  
  for (int i = 0; i < iMax; ++i) {
    if (m_failed == m_d_exray_in_step(ray, 64)) {
      break;
    }
    double _Complex c = m_d_exray_in_get(ray);
    
    if (cabs(c + 0.75) > r) {
      continue;
    }
  
  
    //double t = carg(c +3.14 ); // +0.75
    double t = cimag(c) > 0 ? twopi / 4 : -twopi / 4;
 
    double _Complex dc = 1;
    m_d_transform_reverse(transform, &c, &dc);
    if (first) {
      cairo_save(cr);
      cairo_translate(cr, creal(c) + dx, cimag(c) + dy);
      cairo_rotate(cr, -t);
      cairo_select_font_face(cr, "LMMono10", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
      cairo_set_font_size(cr, 15);
      //cairo_text_path(cr, s_b_angle); 
      cairo_fill(cr);
      cairo_restore(cr);
      cairo_move_to(cr, creal(c) + dx, cimag(c) + dy);
      first = false;
    } else {
      cairo_line_to(cr, creal(c), cimag(c));
    }
  }
  cairo_stroke(cr);
  cairo_destroy(cr);
}







extern int main(int argc, char **argv) {
  (void) argc; // https://stackoverflow.com/questions/21045615/what-does-voidvar-actually-do
  (void) argv;
  int w = 1500;
  int h = 500;
  double r = 3.0;
  m_pixel_t black = m_pixel_rgba(0, 0, 0, 1);
  m_pixel_t white = m_pixel_rgba(1, 1, 1, 1);
  double er = 100;
  int maxiters = 100100;
  const char *filename = "3_1500____.png";
  m_pixel_t red   = m_pixel_rgba(1, 0, 0, 1);
 
  
  
  // m_d_transform.c
  m_d_transform *rect = m_d_transform_rectangular(w, h, -2.5 * r, r);
  m_d_transform *exponential = m_d_transform_exponential(-1.401155189093314712);
  m_d_transform *transform = m_d_transform_compose(rect, exponential);
  m_d_colour_t *colour = m_d_colour_minimal(white, black, white);
  m_image *image = m_image_new(w, h);
    

  m_d_render_scanline(image, transform, er, maxiters, colour);
  
  
  // period 1
  draw_external_ray(image, transform, ".(0)","0/1", red, 0, 0, 1000);
  draw_external_ray(image, transform, ".(1)","1/1", red, 0, 0, 1000);
    // period 2
  draw_external_ray(image, transform, ".(01)","1/3", red, 0, 0, 1000);
  draw_external_ray(image, transform, ".(10)","2/3", red, 0, 0, 1000);
  // period 4
  draw_external_ray(image, transform, ".(0110)","2/5", red, 0, 0, 1000);
  draw_external_ray(image, transform, ".(1001)","3/5", red, 0, 0, 1000);
  // period 8 : The angle  105/255  or  p01101001  The conjugate angle is  150/255  or  p10010110 .
  // The kneading sequence is  ABAAABA*  and the internal address is  1-2-4-8 . The corresponding parameter rays are landing at the root of a satellite component of period 8. It is bifurcating from period 4. 
  draw_external_ray(image, transform, ".(01101001)","105/255", red, 0, 0, 2000);
  draw_external_ray(image, transform, ".(10010110)","150/255", red, 0, 0, 2000);
  /*16 
  
  The angle  27030/65535  or  p0110100110010110 period = 16.
The conjugate angle is  38505/65535  or  p1001011001101001 .
The kneading sequence is  ABAAABABABAAABA*  and the internal address is  1-2-4-8-16 . The corresponding parameter rays are landing at the root of a satellite component of period 16. It is bifurcating from period 8.
  */
  draw_external_ray(image, transform, ".(0110100110010110)","27030/65535", red, 0, 0, 3000);
  draw_external_ray(image, transform, ".(1001011001101001)","38505/65535 ", red, 0, 0, 3000);
  /* 32 
  The angle  1771476585/4294967295  or  p01101001100101101001011001101001 has  preperiod = 0  and  period = 32.
     The conjugate angle is  2523490710/4294967295  or  p10010110011010010110100110010110 .
The kneading sequence is  ABAAABABABAAABAAABAAABABABAAABA*  and the internal address is  1-2-4-8-16-32 . The corresponding parameter rays are landing at the root of a satellite component of period 32. It is bifurcating from period 16. 
*/
   draw_external_ray(image, transform, ".(01101001100101101001011001101001)","1771476585/4294967295", red, 0, 0, 5000);
  draw_external_ray(image, transform, ".(10010110011010010110100110010110)","2523490710/4294967295 ", red, 0, 0, 5000);
  /* 64
  The angle  7608434000728254870/18446744073709551615  or  p0110100110010110100101100110100110010110011010010110100110010110 has  preperiod = 0  and  period = 64.
   The conjugate angle is  10838310072981296745/18446744073709551615  or  p1001011001101001011010011001011001101001100101101001011001101001 .
    The kneading sequence is  ABAAABABABAAABAAABAAABABABAAABABABAAABABABAAABAAABAAABABABAAABA*  and the internal address is  1-2-4-8-16-32-64 . The corresponding parameter rays are landing at the root of a satellite component of period 64. It is bifurcating from period 32.
  */
  
   draw_external_ray(image, transform, ".(0110100110010110100101100110100110010110011010010110100110010110)","7608434000728254870/18446744073709551615", red, 0, 0, 7000);
  draw_external_ray(image, transform, ".(1001011001101001011010011001011001101001100101101001011001101001)","10838310072981296745/18446744073709551615", red, 0, 0, 7000);
  
  /* 128   */	
	
  draw_external_ray(image, transform, ""," 7608434000728254871/18446744073709551617", red, 0, 0, 20000);
  draw_external_ray(image, transform, "","10838310072981296746/18446744073709551617", red, 0, 0, 20000);
  
 /* 256   */	
	
  draw_external_ray(image, transform, "","140350834813144189858090274002849666666/340282366920938463463374607431768211457", red, 0, 0, 25000);
  draw_external_ray(image, transform, "","199931532107794273605284333428918544791/340282366920938463463374607431768211457", red, 0, 0, 50000);
  
   /* 512   */	
	
  draw_external_ray(image, transform, "","47758914269546354982683078068829456704164423862093743397580034411621752859031/115792089237316195423570985008687907853269984665640564039457584007913129639937", red, 0, 0, 25000);
  draw_external_ray(image, transform, "","68033174967769840440887906939858451149105560803546820641877549596291376780906/115792089237316195423570985008687907853269984665640564039457584007913129639937", red, 0, 0, 50000);

   /* 1024   */	
	
  draw_external_ray(image, transform, "","5530104462976645357789668135246717684213577438570812788713795609160074859779972275850010568946600338938152850280993543564372004400437191884797533843002986/13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084097", red, 0, 0, 100000);
  draw_external_ray(image, transform, "","7877703466965951741784356862959128443265788382021580589009765834561689170293574700951863729220303088751879007905492507289381878411509378061636115163081111/13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084097", red, 0, 0, 100000);

  
   /* 2018   */	
	
  draw_external_ray(image, transform, "","74146578472109212997136511361482254487891641386702620145716156204378150869765806841403385319857558565549512234915555076261584853249966913297281241601813858394614116897041089993247811088911534355298428851353473257124296480147861272197456166579083811387730393363010282273585299534106637649680409542459252107671/179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217", red, 0, 0, 100000);
  draw_external_ray(image, transform, "","105622735014122377775794007717420218873906056507528037127713924953354524935735156291305092002549977455570601644955838281397204915564449709195566189037660265983153776527824395283054408512334559764154654100731532511713854202194601609276456943961743425775620117321576015966361946404373078655154946787164972029546/179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137217", red, 0, 0, 100000);

  
  
  m_image_save_png(image, filename);
  //
  return 0;
}

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Feigenbaum%20stretch.pngCategory:Self-published work
Category:Mandelbrot sets (detail) Category:External rays Category:Complex quadratic map Category:Images with C source code Category:Cairo (graphics) Category:Complex plane Category:Period-doubling bifurcation Category:Mandelbrot sets - Mercator projection
  1. Fractalshades doc : P01-feigenbaum expmap
Category:CC-BY-SA-4.0 Category:Cairo (graphics) Category:Complex plane Category:Complex quadratic map Category:External rays Category:Images with C source code Category:Mandelbrot sets (detail) Category:Mandelbrot sets - Mercator projection Category:Period-doubling bifurcation Category:Self-published work