Last active
December 20, 2015 13:33
-
-
Save butchi/59d81c2af9beee1f2b33 to your computer and use it in GitHub Desktop.
フィボナッチ列フラクタル(Mathematicaショートフラクタルシリーズ) ref: http://qiita.com/butchi_y/items/fe0fa7d3e7909ec00210
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w = Flatten[Nest[{#, #[[1]]} &, {1, 0}, 20]]; | |
ListPlot[{Re[#], Im[#]} & /@ | |
Accumulate[ | |
Join[ | |
{0}, | |
I^Accumulate[Join[{1}, w*(-1)^Mod[Range[Length[w]], 2]]] | |
] | |
], | |
Joined -> True, | |
AspectRatio -> Automatic | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Graphics[Line[{Re[#],Im[#]}&/@FoldList[Plus,0,I^FoldList[Plus,1,Flatten[Nest[{#,#[[1]]}&,{1,0},20]]*(-1)^Range[28657]]]]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In[1] := w = Flatten[Nest[{#, #[[1]]} &, {1, 0}, 5]]; | |
Out[1] := {1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In[2] := Accumulate[Join[{1}, w*(-1)^Mod[Range[Length[w]], 2]]] | |
Out[2] := {1, 0, 0, -1, 0, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 2, 3, 2, 2, 1, 1, 0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In[3] := I^Accumulate[Join[{1}, w*(-1)^Mod[Range[Length[w]], 2]]] | |
Out[3] := {I, 1, 1, -I, 1, 1, I, I, -1, I, I, 1, I, I, -1, -1, -I, -1, -1, I, I, | |
1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment