User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
0 = solid square, 10 = max detail
Classical = 0.33 (1/3 removal)
Presets:
Squares
Side Length
Filled Area
Fractal Dim.
Render Time
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Cantor Dust is the two-dimensional analog of the classical Cantor Set, constructed by taking the Cartesian product of two middle-thirds Cantor Sets. At each iteration, a filled square is subdivided into a 3 ร— 3 grid and only the four corner sub-squares are retained. After n iterations the figure contains 4n squares, each with side length (1 รท 3)n of the original. The Hausdorff dimension converges to log(4) รท log(3) 1.2619, making it a measure-zero set with non-integer dimension. Miscounting iterations or misunderstanding the gap ratio leads to incorrect fractal dimension estimates in academic work. This tool applies the exact recursive subdivision and lets you vary the gap fraction from the classical 1/3 removal to arbitrary proportions, useful for studying generalized Cantor constructions.

The generator renders up to 8 levels of recursion in real time on an HTML5 Canvas. Note: at iteration 8 the renderer draws 65,536 rectangles. Higher iterations are supported but rendering time increases by a factor of 4 per level. The gap ratio parameter controls what fraction of each sub-square is removed. A ratio of 0 produces a filled square. A ratio approaching 1 collapses the dust to four points. Classical Cantor Dust uses a gap ratio of 1/3.

cantor dust fractal generator cantor set fractal visualization math art self-similar fractal dimension

Formulas

The classical Cantor Dust is formed by recursively removing the center cross from a square. At each recursion level, each surviving square of side s is divided into a 3 ร— 3 grid and only the 4 corner cells are kept.

N(n) = 4n
s(n) = 13n

The total filled area after n iterations is:

A(n) = 4n โ‹… 19n = 4n9n

The Hausdorff (fractal) dimension is:

D = log(N)log(1 รท r) = log(4)log(3) 1.2619

For a generalized gap ratio g (where 0 < g < 1), the scaling factor becomes r = (1 โˆ’ g) รท 2, and the fractal dimension generalizes to:

Dgen = log(4)log(1 รท r) = log(4)โˆ’log((1 โˆ’ g) รท 2)

Where N(n) = number of squares at iteration n. s(n) = side length of each square at iteration n. A(n) = total filled area fraction. D = Hausdorff dimension. r = contraction ratio. g = gap ratio (fraction removed from the center). N = number of self-similar pieces (4 for Cantor Dust).

Reference Data

Iteration (n)SquaresSide LengthTotal Filled AreaRemoved AreaCumulative Ratio
0111.00000.0000100.00%
141/30.44440.555644.44%
2161/90.19750.802519.75%
3641/270.08780.91228.78%
42561/810.03900.96103.90%
51,0241/2430.01730.98271.73%
64,0961/7290.00770.99230.77%
716,3841/21870.00340.99660.34%
865,5361/65610.00150.99850.15%
9262,1441/196830.000680.999320.068%
101,048,5761/590490.000300.999700.030%
n4n(1/3)n(4/9)n1 โˆ’ (4/9)n -

Frequently Asked Questions

The classical gap ratio is 1/3, yielding dimension log(4) รท log(3) โ‰ˆ 1.2619. Increasing the gap ratio removes more material per iteration, reducing the contraction ratio r = (1 โˆ’ g) รท 2. A smaller r means a larger denominator in the dimension formula, so the fractal dimension decreases toward 0. Conversely, a gap ratio approaching 0 causes r to approach 0.5, pushing the dimension toward 2 (a filled square).
At each iteration the area is multiplied by 4/9 (for the classical case). After n iterations, the area is (4/9)n. Since 4/9 < 1, this converges to 0 as n โ†’ โˆž. The Cantor Dust is a set of Lebesgue measure zero. It contains uncountably many points (cardinality of the continuum) yet occupies no area. This is a defining property of fractal dust sets.
Cantor Dust is the Cartesian product of two standard middle-thirds Cantor Sets: C ร— C. A point (x, y) belongs to the Dust if and only if both x and y belong to the Cantor Set. The 1D Cantor Set has dimension log(2) รท log(3) โ‰ˆ 0.6309. The product dimension is additive: 0.6309 + 0.6309 = 1.2619, confirming the 2D formula.
On a 1920 ร— 1080 display, a canvas of 800px width gives each square at iteration n a side of 800 รท 3n pixels. At n = 6, side โ‰ˆ 1.1 px. At n = 7, side โ‰ˆ 0.37 px. Beyond iteration 6, squares are sub-pixel and antialiased by the browser. For print-quality output at 300 DPI, increase canvas resolution to 3000+ pixels.
Yes. The 3D analog is called Cantor Cheese or Cantor Cube Dust. It is formed by taking C ร— C ร— C. Each iteration divides the cube into 27 sub-cubes and keeps only the 8 corners. The Hausdorff dimension is log(8) รท log(3) โ‰ˆ 1.8928. In general, the d-dimensional Cantor Dust has dimension d โ‹… log(2) รท log(3).
At iteration n, the renderer must draw 4n rectangles. At n = 8, that is 65,536 draw calls. The tool uses iterative (stack-based) traversal instead of recursive function calls to avoid call-stack overflow. Canvas batch rendering via fillRect is highly optimized in modern browsers. For n โ‰ฅ 9, a progress indicator is shown and rendering is chunked across animation frames to keep the UI responsive.