跳轉到內容

分形/複平面迭代/原子域

來自華夏公益教科書,自由的教科書,面向自由的世界
  • 週期域
  • 原子域.[1][2]
  • BOF61(見《分形的美麗》第 61 頁)[3][4]
  • 軌道陷阱 at (0,0) [5]
  • mclosetime

在曼德布羅特集 (引數平面) 的情況下,原子域是引數平面中具有相同索引 p 的部分。

  • 它是正整數
  • 對於 p=1,域是整個平面,因為在演算法中,複數模的值與無窮大進行比較
  • 它等於
    • 曼德布羅特集的雙曲分量的週期,該分量在域內
    • 臨界點迭代時 z 的模在迭代過程中最小化的迭代次數

請注意 

  • 原子域是重疊的
  • "原子域包圍著相同週期的雙曲分量,並且通常比分量本身大得多"[6]
  • "這些域完全包圍著相同週期的雙曲分量"
  • "原子域完全在其自己的牛頓盆地內,並且也比相應的元件大得多"[7]

原子域包含 

    • 週期為 n 的曼德布羅特集的分量 mv
    • 該分量的外部
    • 一些其他分量

重要性

[編輯 | 編輯原始碼]

它可以用於 

  • 快速查詢(近似)曼德布羅特集的週期為 n 的分量及其中心,(域大於分量,這使得它們在查詢分量時很有用)

演算法

[編輯 | 編輯原始碼]

整個引數平面

[編輯 | 編輯原始碼]
// code from :
// http://mathr.co.uk/blog/2014-11-02_practical_interior_distance_rendering.html
// C program by Claude Heiland-Allen
complex double z = 0;
      complex double dc = 0;
      double minimum_z2 = infinity; // atom domain
      int period = 0;

      // iteration 
      for (int n = 1; n <= maxiters; ++n) {
        dc = 2 * z * dc + 1;
        z = z * z + c;
        double z2 = cabs2(z);

        if (z2 < minimum_z2) {
          minimum_z2 = z2;
          period = n;}}

Shadertoy

這是《分形的美麗》這本書第 63 頁描述的方法,但影像在第 61 頁。

點的顏色與 

  • z 達到最小值所需的時間成正比
  • 臨界點的迭代使軌道最接近原點
  • 索引 (c) 是軌道點最接近原點的迭代次數。由於可能存在多個最接近點,因此索引(c) 是最小的一個。

該演算法顯示了具有相同索引(c) 的域的邊界[8][9]

程式碼片段 : Gnofract4d 中的 fractint.cfrm [10]

bof61 {
 init:
       int current_index = -1 ; -1 to match Fractint's notion of iter count
       int index_of_closest_point = -1
       float mag_of_closest_point = 1e100
 loop:
       current_index = current_index + 1
       float zmag = |z|
       if zmag < mag_of_closest_point
               index_of_closest_point = current_index
               mag_of_closest_point = zmag
       endif
 final:
       #index = index_of_closest_point /256.0
}

Cpp 函式

//       function is based on function mclosetime
//       from mbrot.cpp 
//       from program mandel by Wolf Jung 
//      http:www.iram.rwth-aachen.de/~jung/indexp.html  
////8 = iterate =  bof61
// bailout2=4 
int mclosetime(std::complex<double> C , int iter_max,  int bailout2)
{ int j, cln = 0;
  double x = C.real(), y = C.imag(), u, cld = 4;
  for (j = 0; j <= iter_max; j++)
  { u = x*x + y*y; 
    if (u > bailout2) return j;
    if (u < cld) {cld = u;cln = j; }
 
    u = x*x - y*y + C.real();
    y = 2*x*y + C.imag();
    x = u;
  }
  return iter_max + cln % 15; //iterate, bof61
  
}

它可以用於 

// compute escape time  
              int last_iter= mclosetime(C,iter_max,bailout2);
              //  drawing code */
              if (last_iter>=iter_max) { putpixel(ix,iy,last_iter - iter_max);} // interior
                                else putpixel(ix,iy,WHITE); // exterior
原子域 : 請注意,原子域會重疊,並且“完全包圍著相同週期的雙曲分量”[11]

請注意,這種方法可以應用於外部和內部。它被稱為原子域。[12] 它也可以被修改[13]

原子域的大小

[編輯 | 編輯原始碼]

大小估計[14]

用於從核 c 和其週期 p 計算原子域大小估計的函式 

// code by Claude Heiland-Allen
// from http://mathr.co.uk/blog/2013-12-10_atom_domain_size_estimation.html
real_t atom_domain_size_estimate(complex_t c, int_t p) {
  complex_t z = c;
  complex_t dc = 1;
  real_t abszq = cabs(z);
  for (int_t q = 2; q <= p; ++q) {
    dc = 2 * z * dc + 1;
    z = z * z + c;
    real_t abszp = cabs(z);
    if (abszp < abszq && q < p) {
      abszq = abszp;
    }
  }
  return abszq / cabs(dc);
}

參考文獻

[編輯 | 編輯原始碼]
  1. 羅伯特·穆納福的原子域
  2. 克勞德·海蘭德-艾倫的實用內部距離渲染
  3. 英文維基百科中的分形之美
  4. 華夏公益教科書中的Bof61演算法
  5. 霍博德在(0,0)處的軌道陷阱
  6. 克勞德的misiurewicz_domains
  7. 克勞德·海蘭德-艾倫的曼德博集合牛頓盆
  8. 諾埃爾·吉芬的Fractint 文件
  9. 帕特里克·哈恩的曼德博集合中的一系列螺旋灣
  10. gnofract4d
  11. 克勞德·海蘭德-艾倫的實用內部距離渲染
  12. 來自曼德博集合詞彙表和百科全書的原子域,作者羅伯特·穆納福
  13. 克勞德·海蘭德-艾倫的修改後的原子域
  14. 克勞德·海蘭德-艾倫的原子域大小估計
華夏公益教科書