作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道是否有人可以帮助我绘制 Cantor dust在 Mathematica 的飞机上。这链接到 Cantor set .
非常感谢。
编辑
我实际上想要这样的东西:
最佳答案
这是为 ternary Cantor set construction 再现图形的一种幼稚且可能不是很优化的方法。 :
cantorRule = Line[{{a_, n_}, {b_, n_}}] :>
With[{d = b - a, np = n - .1},
{Line[{{a, np}, {a + d/3, np}}], Line[{{b - d/3, np}, {b, np}}]}]
Graphics[{CapForm["Butt"], Thickness[.05],
Flatten@NestList[#/.cantorRule&, Line[{{0., 0}, {1., 0}}], 6]}]
dust4=Flatten@Nest[#/.cantorRule&,Line[{{0.,0},{1.,0}}],4]/.Line[{{a_,_},{b_,_}}]:>{a,b}
dust4 = Transpose /@ Tuples[dust4, 2];
Graphics[Rectangle @@@ dust4]
n = 3; choice = {1, 3};
CanDChoice = c:CanD[__]/;Length[c]===n :> CanD[c[[choice]]];
splitRange = {a_, b_} :> With[{d = (b - a + 0.)/n},
CanD@@NestList[# + d &, {a, a + d}, n - 1]];
cantLevToRect[lev_]:=Rectangle@@@(Transpose/@Tuples[{lev}/.CanD->Sequence,2])
dust = NestList[# /. CanDChoice /. splitRange &, {0, 1}, 4] // Rest;
Graphics[{FaceForm[LightGray], EdgeForm[Black],
Table[cantLevToRect[lev], {lev, Most@dust}],
FaceForm[Black], cantLevToRect[Last@dust /. CanDChoice]}]
n = 7; choice = {1, 2, 4, 6, 7};
dust = NestList[# /. CanDChoice /. splitRange &, {0, 1}, 2] // Rest;
关于wolfram-mathematica - 如何在mathematica中生成平面康托图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6631333/
我是一名优秀的程序员,十分优秀!