-2
$\begingroup$

In the post graph of the Cantor set in Mathematica, there are many nice plots of the Cantor set.

It is possible to use Mathematica to produce

  • the plot of a $360°$ rotation of the Cantor set around the point $1/2$?
  • the plot of the set obtained by putting Cantor sets continuously "side by side" in the $[0,1] \times [0,1]$ square? That is, just "replacing the dots" in the Cantor set with vertical lines of length one
$\endgroup$
1
  • 1
    $\begingroup$ The answers to both questions are Yes. Are you looking for a free coding service? $\endgroup$
    – Roman
    Commented May 3, 2019 at 19:59

2 Answers 2

5
+100
$\begingroup$

If I understand the question correctly, we could make a mesh with CantorMesh, convert it to lines with MeshPrimitives, then use a replacement rule to convert the lines to either annuli or rectangles to be wrapped in Graphics.

Rotated 360 degrees around $(1/2,0)$:

Graphics[MeshPrimitives[CantorMesh[6], 1] /.
{Line[{{x1_}, {x2_}}] :> Annulus[{0.5, 0}, Sort[Abs[{0.5, 0.5} - {x1, x2}]]]}]

Mathematica graphics

Extended vertically to the unit square:

Graphics[MeshPrimitives[CantorMesh[6], 1] /. 
Line[{{x1_}, {x2_}}] :> Rectangle[{x1, 0}, {x2, 1}]]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ That's great. Thanks. $\endgroup$
    – Riku
    Commented May 7, 2019 at 18:23
3
$\begingroup$

Here's one way to make 2D Cantor plots:

CantorMesh[4, 2]

enter image description here

Change the first number to plot at higher levels. Change the second number to 3 for a 3D plot:

CantorMesh[2, 3]

enter image description here

$\endgroup$
3
  • $\begingroup$ Thank you. But in the second part of the question I actually didn't mean a multi-dimensional cantor dust, but just "replacing the dots" in the cantor set with vertical lines of lenght one. $\endgroup$
    – Riku
    Commented May 3, 2019 at 20:39
  • 3
    $\begingroup$ I answered the question you asked, not the one you intended to ask. $\endgroup$
    – bill s
    Commented May 3, 2019 at 20:41
  • $\begingroup$ Technically you didn't: that picture is not "the plot of the set obtained by putting Cantor sets continuously "side by side" in the $[0,1] \times [0,1]$ square". Thanks anyway for the effort, though. $\endgroup$
    – Riku
    Commented May 3, 2019 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.