謝爾賓斯基地毯

謝爾賓斯基地毯

數學家謝爾賓斯基提出的分形圖形
謝爾賓斯基地毯是數學家謝爾賓斯基提出的一個分形圖形。[1]謝爾賓斯基地毯和謝爾賓斯基三角形基本類似,不同之處在于謝爾賓斯基地毯采用的是正方形進行分形構造,而謝爾賓斯基三角形采用的等邊三角形進行分形構造。謝爾賓斯基地毯它本身的一部分完全相似。減掉一塊會破壞自相似性。
    中文名:謝爾賓斯基地毯 外文名: 别名: 英文名:Sher Pinsky carpet 時間:1916年 提出者:謝爾賓斯基

介提出者

謝爾賓斯基地毯是由瓦茨瓦夫·謝爾賓斯基于1916年提出的一種分形,是自相似集的一種。它的豪斯多夫維是 log 8/log 3 ≈ 1.8928。門格海綿是它在三維空間中的推廣。

構造

謝爾賓斯基地毯的構造與謝爾賓斯基三角形相似,區别僅在于謝爾賓斯基地毯是以正方形而非等邊三角形為基礎的。将一個實心正方形劃分為的9個小正方形,去掉中間的小正方形,再對餘下的小正方形重複這一操作便能得到謝爾賓斯基地毯。如下圖

謝爾賓斯基地毯可以由以下計算機程序構造:

Decides if a point at a specific location is filled or not.

@param x is the x coordinate of the point being checked

@param y is the y coordinate of the point being checked

@param width is the width of the Sierpinski Carpet being checked

@param height is the height of the Sierpinski Carpet being checked

@return 1 if it is to be filled or 0 if it is not

*/ int isSierpinskiCarpetPixelFilled(int x,int y,int width,int height)

{// base caseif (x<1)

{return 0;}

{/*If the grid was split in 9 parts, what part(x2,y2) would x,y fit into?*/

int x2 = x*3/width; // an integer from 0..2 inclusive

int y2 = y*3/height; // an integer from 0..2 inclusive

if (x2==1 && y2==1) // if in the centre squaure, it should be filled.return 1;/* offset x and y so it becomes bounded by 0..width/3 and 0..height/3and prepares for recursive callx-=x2*width/3;y-=y2*height/3}return isSierpinskiCarpetPixelFilled(x,y,width/3,height/3);

上一篇:社會公信力

下一篇:環刀法

相關詞條

相關搜索

其它詞條