tag:blogger.com,1999:blog-84389163088345412942017-06-21T20:07:43.634-07:00Office chair philosophyThis is a set of random ideas that just want to jump out of my head and onto the internet. Who knows whether office chair philosophy is any more credible than arm chair philosophy, but you decide, and let me know.TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.comBlogger40125tag:blogger.com,1999:blog-8438916308834541294.post-16361601220055070552017-05-24T03:37:00.003-07:002017-06-09T03:12:11.009-07:00diamond square fractals<div class="separator" style="clear: both; text-align: left;">I have previously worked on <a href="http://tglad.blogspot.com.au/2012/03/implementing-fractal-automata.html">fractal automata</a> which produce <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/automataFinder">animating patterns in 2D and 3D</a>. A special case of this is where only the larger scale affects the smaller scales, giving static images. One shortcoming with these automata and images is that they have square or cubic symmetry, so features are just at right angles, which gets a bit dull, this was one reason I made <a href="http://tglad.blogspot.com.au/2014/07/symmetric-binary-fractals.html">this cubic modification</a> for 2D images, giving a hexagonal symmetry. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"> A tweet by someone called <a href="https://twitter.com/R4_Unit">R4_Unit</a> showed a different way to achieve a similar goal. Use the <a href="https://en.wikipedia.org/wiki/Diamond-square_algorithm">diamond-square algorithm</a> which is used for plasma fractals and hilly height fields, but use automata rules rather than random offsets. R4_Unit applied this in 3D, and has since submitted his code <a href="https://bitbucket.org/BWerness/voxel-automata-terrain/">here</a>, and a user called Softology has added his own implementation to his <a href="https://www.flickr.com/photos/39445835@N05/sets/72157681216191183">Visions of Chaos</a> software. In 2D the diamond-square algorithm gives a pseudo octagonal symmetry, quite similar to automata rule type 7 that I made in the 2nd link above which gave nice results:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://sites.google.com/site/tomloweprojects/_/rsrc/1480569941852/scale-symmetry/automataFinder/tree.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="510" data-original-width="511" height="199" src="https://sites.google.com/site/tomloweprojects/_/rsrc/1480569941852/scale-symmetry/automataFinder/tree.png" width="200" /></a><a href="https://sites.google.com/site/tomloweprojects/_/rsrc/1480569941852/scale-symmetry/automataFinder/voidSponge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="510" data-original-width="510" height="200" src="https://sites.google.com/site/tomloweprojects/_/rsrc/1480569941852/scale-symmetry/automataFinder/voidSponge.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">But with a rule that is more complicated than diamond-square. The 3D diamond-square is actually cube-irregular_octahedron-octahedron and doesn't have nearly the simple symmetry of diamond-square, so here I investigate what the results look like in 2D.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">For 4 parent points there are 2^4 parent combinations and the central point is either black or white for each, giving 2^16 rule sets. However, once you constrain it to square symmetry, this drops down to only 64 rule sets, which I draw using a 4x4 start grid: </div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0001</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0010</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0011</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">1111</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-XKRD5YgBxm8/WSVidYifc9I/AAAAAAAABRU/pIUWZzNPSR88LNqmsQ3h0OiMUmTvH_ChQCLcB/s1600/automata.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1520" height="640" src="https://2.bp.blogspot.com/-XKRD5YgBxm8/WSVidYifc9I/AAAAAAAABRU/pIUWZzNPSR88LNqmsQ3h0OiMUmTvH_ChQCLcB/s640/automata.png" width="604" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">And for the symmetric start grid:</div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0000</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0110</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0110</span></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">0000</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-xwcwtEZCnJI/WSa3vPaSIUI/AAAAAAAABR4/KROEpGl8MxYsDOc_BhcCiVDPm3-bjTLSgCLcB/s1600/automatabig.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1559" height="640" src="https://4.bp.blogspot.com/-xwcwtEZCnJI/WSa3vPaSIUI/AAAAAAAABR4/KROEpGl8MxYsDOc_BhcCiVDPm3-bjTLSgCLcB/s640/automatabig.png" width="622" /></a></div>five along one up seems like the 'nicest' in both cases.<br /><br />For more than two colours the number of combinations explodes. One way to contain that is to demand 'bit symmetry' which in the two-colour case means the rule sets acts the same if black and white are swapped. Unfortunately it is not possible to have a two-colour bit symmetric rule with this diamond-square approach, because there are an even number of identical parents. If two parents are white and two are black then there is no child colour that acts the same if black and white are reversed.<br /><br />The generalised 'bit symmetry' for n colours means the rules are the same if the n colours are permuted in any way. Then for three colours it is possible to have bit symmetric rules, and there are only three of them:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-TnSUMmuSgOc/WSa35dYR5KI/AAAAAAAABR8/hG6VegcSpDQMrGhdkon_xuBecgpqPCVhACLcB/s1600/automata3colour.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="541" data-original-width="1600" height="216" src="https://2.bp.blogspot.com/-TnSUMmuSgOc/WSa35dYR5KI/AAAAAAAABR8/hG6VegcSpDQMrGhdkon_xuBecgpqPCVhACLcB/s640/automata3colour.png" width="640" /></a></div>Overall the rule is to choose the most popular colour of the parent. If this is a tie, then choose the least popular. The choice occurs when there are three parent corners of a single colour. Do you choose the colour there is none of, one of or three of among the parents? The above shows each respectively.<br /><br />The third is the simpler rule (as it is subsumed by the first criteria), and gives more solid results. Here is a close up of the only complex feature it seems to generate:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-xp7_2VBx6dg/WSa3_tOCMEI/AAAAAAAABSA/k8dR-AArQ88sWBVl4CukUC6u8gcftz66ACLcB/s1600/automata3colourbig2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="412" data-original-width="440" height="299" src="https://3.bp.blogspot.com/-xp7_2VBx6dg/WSa3_tOCMEI/AAAAAAAABSA/k8dR-AArQ88sWBVl4CukUC6u8gcftz66ACLcB/s320/automata3colourbig2.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">These teardrop shapes are all identical. While they are polygonal, each protrusion seems to have an infinite number of edges, in fact it is a tree. So each teardrop is a tree. </div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">In fact, these are the only three bit-symmetric rule sets possible for the diamond-square algorithm for any number of colours, and none exist in 3D at all (assuming cubic symmetry), so they are quite unique.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">However, a square lattice is not the only scalable lattice, the only other I know is the triangular lattice. And in this lattice bit-symmetric automata occur only with four colours, and there are only two of them:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-plruYO59O3s/WS6m5z4E7CI/AAAAAAAABSg/ls1aCRuhtWU-cNHYh377D_4ZYcEeUoX4gCLcB/s1600/automataTriangle2big.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="614" data-original-width="601" height="200" src="https://2.bp.blogspot.com/-plruYO59O3s/WS6m5z4E7CI/AAAAAAAABSg/ls1aCRuhtWU-cNHYh377D_4ZYcEeUoX4gCLcB/s200/automataTriangle2big.bmp" width="195" /></a><a href="https://4.bp.blogspot.com/-RO06KS5PROk/WS6muM-6ubI/AAAAAAAABSc/XbXSr9cJOTE8u4AWiC8cR9ZrwJm4ukHVgCLcB/s1600/automataTriangle.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="314" data-original-width="301" height="200" src="https://4.bp.blogspot.com/-RO06KS5PROk/WS6muM-6ubI/AAAAAAAABSc/XbXSr9cJOTE8u4AWiC8cR9ZrwJm4ukHVgCLcB/s200/automataTriangle.bmp" width="191" /></a></div><div class="separator" style="clear: both; text-align: left;">The rule is the same as for the square lattice case, but the choice is when two of your parents are the same colour, do you choose the colour there is one of or two of? Again, the more solid results come from the latter case. It is quite a wonderful shape, with almost rounded looking blobs that belie its triangular lattice frame. These used a randomised 4x4(ish) start pattern, and here is higher resolution with an 8x8(ish) start pattern:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-uq0PW_DXofQ/WS6nGZKYC2I/AAAAAAAABSk/hR-dA4Ok_XM2zpGPRJ1RS135WFM8f14qwCLcB/s1600/automataTrianglebig.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="614" data-original-width="601" height="320" src="https://1.bp.blogspot.com/-uq0PW_DXofQ/WS6nGZKYC2I/AAAAAAAABSk/hR-dA4Ok_XM2zpGPRJ1RS135WFM8f14qwCLcB/s320/automataTrianglebig.bmp" width="313" /></a></div><div class="separator" style="clear: both; text-align: left;">The rule for this and the teardrop above are incredibly simple, pick the most popular parent colour, if it is a tie then pick the least popular. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here are three simplest cases:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-61TUa_EiHwE/WTpzfRAU5wI/AAAAAAAABTc/CWbDmuI_dTsUFlI1eSQxzbmH18FgXAPOQCLcB/s1600/trianglepattern2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1548" height="200" src="https://3.bp.blogspot.com/-61TUa_EiHwE/WTpzfRAU5wI/AAAAAAAABTc/CWbDmuI_dTsUFlI1eSQxzbmH18FgXAPOQCLcB/s200/trianglepattern2.png" width="193" /></a><a href="https://4.bp.blogspot.com/-H5AecqJ6bUI/WTpzmj_dunI/AAAAAAAABTg/t2QGj21eVbUsuIRJn4JItrHC8IJIHjZpwCLcB/s1600/trianglepattern3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1558" height="200" src="https://4.bp.blogspot.com/-H5AecqJ6bUI/WTpzmj_dunI/AAAAAAAABTg/t2QGj21eVbUsuIRJn4JItrHC8IJIHjZpwCLcB/s200/trianglepattern3.png" width="194" /></a><a href="https://1.bp.blogspot.com/--5jslKNYu3k/WTkpmEKzgcI/AAAAAAAABTA/Fg2ZTrwGRPIT76ybfHXMS9SEWSL1W1UmACLcB/s1600/trianglepattern.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1087" data-original-width="1037" height="200" src="https://1.bp.blogspot.com/--5jslKNYu3k/WTkpmEKzgcI/AAAAAAAABTA/Fg2ZTrwGRPIT76ybfHXMS9SEWSL1W1UmACLcB/s200/trianglepattern.png" width="190" /></a></div><div class="separator" style="clear: both; text-align: left;">The apparent fifth colour is a nowhere-dense mix of the four colours and primarily takes the shape of a modified Koch snowflake, by contrast the dense colours are all finite sided polygons. </div><div class="separator" style="clear: both; text-align: center;"><br /></div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-67650345448030870802017-04-26T04:13:00.000-07:002017-04-27T02:54:01.775-07:00New basic fractal curvesThe three most well known 2D fractal curves are probably the Von Koch curve, the Levy C curve and the Dragon curve. They are all generated from the same simple replacement rule of one oriented line segment with two in a v-shape:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-_R0F3QqMfPA/WQB-V-KzZ_I/AAAAAAAABO0/tXgzkntk_MouiUc4Ro0K8DkC7_FaSab3QCLcB/s1600/curves.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="110" src="https://2.bp.blogspot.com/-_R0F3QqMfPA/WQB-V-KzZ_I/AAAAAAAABO0/tXgzkntk_MouiUc4Ro0K8DkC7_FaSab3QCLcB/s320/curves.png" width="320" /></a></div><span id="goog_600040306"></span><span id="goog_600040307"></span>The angle of the V-shape controls how rough the resulting curve is. At 60 degrees we get:<br /><div class="separator" style="clear: both; text-align: center;"> Levy:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-aDPlKIpfWAo/WQB_FnfwsTI/AAAAAAAABPA/8fDemc-AelcP3kEGQEANWd5MNVRvxY1OgCLcB/s1600/levy.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-aDPlKIpfWAo/WQB_FnfwsTI/AAAAAAAABPA/8fDemc-AelcP3kEGQEANWd5MNVRvxY1OgCLcB/s200/levy.jpg" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">Koch:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Me_RMgdiRTU/WQB_Fi7WiVI/AAAAAAAABO8/nDTykVJoUv4vhRSWvMnZul3UWAVuqi5-QCLcB/s1600/koch.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-Me_RMgdiRTU/WQB_Fi7WiVI/AAAAAAAABO8/nDTykVJoUv4vhRSWvMnZul3UWAVuqi5-QCLcB/s200/koch.jpg" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">Dragon:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-u5b2yck3g7U/WQB_FqR1pvI/AAAAAAAABPE/PYDbZeFtmogx23JJUN5vzaFE7p9Jtj_dQCLcB/s1600/dragon.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-u5b2yck3g7U/WQB_FqR1pvI/AAAAAAAABPE/PYDbZeFtmogx23JJUN5vzaFE7p9Jtj_dQCLcB/s200/dragon.jpg" width="200" /></a></div><br />What doesn't seem to have been described before is that there are three other fractal curves from this basic construction. In fact, since an oriented line segment can be rotated 180 degrees, reflected around its length, or both, there are four options per child line, so 16 possible fractal curves. However many just give reflected or rotated versions of the same curve, leaving just six unique fractal curves. The remaining three curves look like this, for bend angle 30, 60 and 90 degrees:<br /><br />new curve 1:<br /><div style="text-align: center;"><a href="https://4.bp.blogspot.com/-2aQzfJsq7p4/WQG_BaDfhPI/AAAAAAAABQk/4VwgOGSJCEclskOHJfCceohJc_l7K3gkQCLcB/s1600/type1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: left;"><img border="0" height="56" src="https://4.bp.blogspot.com/-2aQzfJsq7p4/WQG_BaDfhPI/AAAAAAAABQk/4VwgOGSJCEclskOHJfCceohJc_l7K3gkQCLcB/s200/type1.png" width="200" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-k18j7NEL8a8/WQCFppC2xiI/AAAAAAAABP4/MB5BRrSTgSUsK8Cpl-9Df1ACz50OkHwZgCLcB/s1600/new1a30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="61" src="https://2.bp.blogspot.com/-k18j7NEL8a8/WQCFppC2xiI/AAAAAAAABP4/MB5BRrSTgSUsK8Cpl-9Df1ACz50OkHwZgCLcB/s320/new1a30.png" width="320" /></a><a href="https://3.bp.blogspot.com/-2RXFMIcWX2c/WQCAl1nBMCI/AAAAAAAABPQ/Z-cr2Pb2U64lyweIIazj-1gk2-ZDgCPfwCLcB/s1600/new1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://3.bp.blogspot.com/-2RXFMIcWX2c/WQCAl1nBMCI/AAAAAAAABPQ/Z-cr2Pb2U64lyweIIazj-1gk2-ZDgCPfwCLcB/s320/new1.png" width="320" /></a><a href="https://3.bp.blogspot.com/-OlewLvqkbDU/WQCC2b0rSQI/AAAAAAAABPo/kOPCXP_oWAQjv2N0Dp4dABvjEDEwuc8HQCLcB/s1600/new1b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="202" src="https://3.bp.blogspot.com/-OlewLvqkbDU/WQCC2b0rSQI/AAAAAAAABPo/kOPCXP_oWAQjv2N0Dp4dABvjEDEwuc8HQCLcB/s320/new1b.png" width="320" /></a></div><br />new curve 2:<br /><div class="separator" style="clear: both; text-align: left;"><a href="https://4.bp.blogspot.com/-CnizSR3dT5I/WQG_MMAxCzI/AAAAAAAABQo/XcWnwuxyT3Ei961EV1NV1GGi7ZS0pMTtgCLcB/s1600/type2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="56" src="https://4.bp.blogspot.com/-CnizSR3dT5I/WQG_MMAxCzI/AAAAAAAABQo/XcWnwuxyT3Ei961EV1NV1GGi7ZS0pMTtgCLcB/s200/type2.png" width="200" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-nsyK5zlYja0/WQCF_JCH4DI/AAAAAAAABP8/KxbmNKRPmGI425OIc9a4TBfI4ED3HCUFgCLcB/s1600/new2a30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="86" src="https://3.bp.blogspot.com/-nsyK5zlYja0/WQCF_JCH4DI/AAAAAAAABP8/KxbmNKRPmGI425OIc9a4TBfI4ED3HCUFgCLcB/s320/new2a30.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-ERhYvvdGdQY/WQCAl8yBiNI/AAAAAAAABPY/lecwqVsMAvQ7fnbc0osr_x76Hx-lDofrQCLcB/s1600/new2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="193" src="https://3.bp.blogspot.com/-ERhYvvdGdQY/WQCAl8yBiNI/AAAAAAAABPY/lecwqVsMAvQ7fnbc0osr_x76Hx-lDofrQCLcB/s320/new2.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-GHc2UKvb8Ko/WQCB7QvqGtI/AAAAAAAABPg/QWWcrdkf92gicFdstQvB_SsLwUeBAVBEgCLcB/s1600/new2b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://4.bp.blogspot.com/-GHc2UKvb8Ko/WQCB7QvqGtI/AAAAAAAABPg/QWWcrdkf92gicFdstQvB_SsLwUeBAVBEgCLcB/s320/new2b.png" width="289" /></a></div><div class="separator" style="clear: both; text-align: left;">This has a critical point, just before it starts overlapping, at about 85.5 degrees:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Ukby9ZmoI98/WQCG9ZLofhI/AAAAAAAABQM/NgCxvxIg-0kMr7n3xW-1aNE0s7Lcu34mgCLcB/s1600/new2c85p5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="299" src="https://4.bp.blogspot.com/-Ukby9ZmoI98/WQCG9ZLofhI/AAAAAAAABQM/NgCxvxIg-0kMr7n3xW-1aNE0s7Lcu34mgCLcB/s320/new2c85p5.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">new curve 3:</div><div class="separator" style="clear: both; text-align: left;"><a href="https://1.bp.blogspot.com/-7eZQl_z6B0c/WQG_RnXRMmI/AAAAAAAABQs/8jem1JUO1gsSmMitJcYZDYLfqz5C3C_AQCLcB/s1600/type3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="56" src="https://1.bp.blogspot.com/-7eZQl_z6B0c/WQG_RnXRMmI/AAAAAAAABQs/8jem1JUO1gsSmMitJcYZDYLfqz5C3C_AQCLcB/s200/type3.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-456CAorwmeQ/WQCGL3PAd0I/AAAAAAAABQA/55jj0ScZ5lE0S9OuZpBl5Y7rE3fwCQR4gCLcB/s1600/new3a30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="77" src="https://2.bp.blogspot.com/-456CAorwmeQ/WQCGL3PAd0I/AAAAAAAABQA/55jj0ScZ5lE0S9OuZpBl5Y7rE3fwCQR4gCLcB/s320/new3a30.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/--28zepws698/WQCGq_NR8aI/AAAAAAAABQI/pZ8NEHNNG8UZHfMN_UlPTx-EjFNT7fTDQCLcB/s1600/new3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="https://3.bp.blogspot.com/--28zepws698/WQCGq_NR8aI/AAAAAAAABQI/pZ8NEHNNG8UZHfMN_UlPTx-EjFNT7fTDQCLcB/s320/new3.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-ZP5xZQLoHL0/WQCC6GxA5SI/AAAAAAAABPs/A4oVyYXHvRcZq09qHVnNIi1F2bHNcmc6QCLcB/s1600/new3b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="305" src="https://4.bp.blogspot.com/-ZP5xZQLoHL0/WQCC6GxA5SI/AAAAAAAABPs/A4oVyYXHvRcZq09qHVnNIi1F2bHNcmc6QCLcB/s320/new3b.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">This last curve is especially interesting because, like the Von Koch curve, it curls into a solid triangle without any overlap, here is is at 85.5 degrees:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-xETLr81uh9I/WQCHf7ZA6SI/AAAAAAAABQU/EQ-tH72lpqcWDAOKSFpiDMTO9cDPw46OwCLcB/s1600/new3c85p5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://4.bp.blogspot.com/-xETLr81uh9I/WQCHf7ZA6SI/AAAAAAAABQU/EQ-tH72lpqcWDAOKSFpiDMTO9cDPw46OwCLcB/s320/new3c85p5.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-30210311566596328532017-01-30T03:11:00.001-08:002017-03-29T17:10:49.430-07:00The Colour of 2D FractalsIn my <a href="http://tglad.blogspot.com.au/2016/12/the-colour-of-3d-fractals.html">previous post</a> I began experimenting with structure on 3D fractals. After some reading it seems there are four ways in which the shape of an object can give it colour:<br /><ol><li>variable distance to eye causing interference on incoming coherent light</li><li>interference of reflected and refracted light on (semi)transparent objects</li><li>greater scattering of bluer light, causing a <a href="https://en.wikipedia.org/wiki/Tyndall_effect">Tyndall</a>/<a href="https://en.wikipedia.org/wiki/Rayleigh_scattering">Rayleigh</a> type reflected corona on a rough surface</li><li>if the geometry absorbs some light then the colour that causes more reflections before seeing a diffuse sky will be darker</li></ol>The first only works on coherent incoming light, which only really happens with a bright sun on a non cloudy day. The second requires a refraction index and so I'll leave this for now. The third is interesting but really represents coloured corona of individual light sources, and doesn't occur on the diffuse light. so I'll focus on the fourth case..<br /><br />The idea here is that when a wave reflects off some complex geometry, one can 'low pass' the geometry based on the wavelength of the light, that is, one can ignore small bits of geometry below the light's wavelength as it has little effect. An approximation of this idea for simple fractals is to just look at the red and blue light frequencies, which are roughly different by a factor of 2, and use one more fractal iteration for the blue light than the red. The fractal I'm looking at is a simple 2D replacement of one directed line by two of equal length in a v shape:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-jCARBVP3WiQ/WJACD2mceGI/AAAAAAAABB8/AB48mEsIsLsOCkMCppLrw51MPjKXdmawwCLcB/s1600/Untitled%2BDiagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="137" src="https://3.bp.blogspot.com/-jCARBVP3WiQ/WJACD2mceGI/AAAAAAAABB8/AB48mEsIsLsOCkMCppLrw51MPjKXdmawwCLcB/s400/Untitled%2BDiagram.png" width="400" /></a></div><br />If the two child lines are pointing along the same way then it produces a <a href="https://en.wikipedia.org/wiki/L%C3%A9vy_C_curve">Levy curve</a>, if both are flipped around then it produces a <a href="https://en.wikipedia.org/wiki/Koch_snowflake">Koch curve</a>, and if only one is flipped it produces a <a href="https://en.wikipedia.org/wiki/Dragon_curve">dragon curve</a>. In each case the bend angle affects the dimension, which goes from 1D to 2D as the angle approaches 90 degrees. When I talk about the colour of such a 2D fractal, I mean when looking 'side on' to the curve, not from plan view.<br /><h4></h4><h4>Reflection Model</h4><div>I model the surface as having no transparency, and reflecting light exactly. However I include a reflectivity. If the reflectivity is 100% then all the incoming light energy should be reflected back, regardless of the number of 'bounces', and regardless of the wavelength, therefore the curve is white. If the reflectivity is 0% then the curve is black. Firstly, I will look at the case where the reflectivity is very low but the diffuse sky intensity is very high, I therefore can approximate the colour by only looking at one reflection, and not multiple. It is expected that the colour will get paler as the reflectivity increases.</div><div><br /></div><div>The first reflection model I call the <i>diffuse model</i>. Each vertex of the curve calculates the proportion of sky that is visible from its position, looking only to one side of the curve. It therefore models the reflection as going in all directions (as though from a point). </div><div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Hoq1DjP9CTQ/WJApgjoxjtI/AAAAAAAABCs/HLVwfVLN9us9efbiw3aZqZocL25r1gclQCLcB/s1600/diffusemodel%2B%25284%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://1.bp.blogspot.com/-Hoq1DjP9CTQ/WJApgjoxjtI/AAAAAAAABCs/HLVwfVLN9us9efbiw3aZqZocL25r1gclQCLcB/s200/diffusemodel%2B%25284%2529.png" width="192" /></a><a href="https://2.bp.blogspot.com/-HKSNiFpWzIE/WJAn3dgX3HI/AAAAAAAABCY/qtTr_M6M7fEVg30IZJuvuclJXjpqWwRggCLcB/s1600/reflectmodel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://2.bp.blogspot.com/-HKSNiFpWzIE/WJAn3dgX3HI/AAAAAAAABCY/qtTr_M6M7fEVg30IZJuvuclJXjpqWwRggCLcB/s200/reflectmodel.png" width="200" /></a></div></div><div>The second reflection model I call the <i>reflect model, </i>I model each vertex and the two line segments coming from it, as a (circularly) curved mirror. The light heading towards the camera therefore comes from a uniform distribution of directions which I calculate. The light level then represents the proportion of this angular section that is not occluded by the curve. </div><h4></h4><h4></h4><h4>Levy Curve</h4><div>For each model I show the fractal of dimension 1.2D, with colours as viewed orthogonally from above. Below that I show a map of the 1D view of the fractal as seen from above (horizontal) for increasing dimension 1 to 1.5 (vertical). </div><table style="width: 100%;"> <tbody><tr> <th><i>diffuse model</i></th> <th><i>reflect model</i></th> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-NnB-CdIWWh0/WI3Tv8O8NXI/AAAAAAAAA-Q/GtW4Bg254NIQ1aVu16nYJasCnYrUBoqGgCEw/s1600/levydiffuseb.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-NnB-CdIWWh0/WI3Tv8O8NXI/AAAAAAAAA-Q/GtW4Bg254NIQ1aVu16nYJasCnYrUBoqGgCEw/s200/levydiffuseb.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-5yk6vXU8uYk/WI3U7eCVgrI/AAAAAAAAA-U/wMjW_QMG4tIPwtrBL3Cqw7C6ayucl20jQCLcB/s1600/Levy1Diffuseconcave.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://4.bp.blogspot.com/-5yk6vXU8uYk/WI3U7eCVgrI/AAAAAAAAA-U/wMjW_QMG4tIPwtrBL3Cqw7C6ayucl20jQCLcB/s320/Levy1Diffuseconcave.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-0tKnWh80zto/WI3Tv0ISnXI/AAAAAAAAA-Q/2BtPIVrqXxE9j1AZiSewa6GhVBHQM_AWgCEw/s1600/levyReflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-0tKnWh80zto/WI3Tv0ISnXI/AAAAAAAAA-Q/2BtPIVrqXxE9j1AZiSewa6GhVBHQM_AWgCEw/s200/levyReflect.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-2c__U5_55l8/WJBxWDvuaFI/AAAAAAAABDI/7R-YOJW_YjIGx-FcnoaONoEHwERahIAlgCLcB/s1600/levyDimensionReflectb.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://4.bp.blogspot.com/-2c__U5_55l8/WJBxWDvuaFI/AAAAAAAABDI/7R-YOJW_YjIGx-FcnoaONoEHwERahIAlgCLcB/s320/levyDimensionReflectb.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-yp1tx82G0d4/WI3Tv3FE2II/AAAAAAAAA-Q/6PSAYMNNhlI-mrXKC2XZDfAotT2kthD5ACEw/s1600/levydiffuseFlip.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-yp1tx82G0d4/WI3Tv3FE2II/AAAAAAAAA-Q/6PSAYMNNhlI-mrXKC2XZDfAotT2kthD5ACEw/s200/levydiffuseFlip.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-wDfse7w9ZTs/WI3VQ9i-DFI/AAAAAAAAA-c/UEFYjFu-k6YvfG3oY2p-cljoLJvY-vgwQCLcB/s1600/Levy1DiffuseFlipConvex.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://1.bp.blogspot.com/-wDfse7w9ZTs/WI3VQ9i-DFI/AAAAAAAAA-c/UEFYjFu-k6YvfG3oY2p-cljoLJvY-vgwQCLcB/s320/Levy1DiffuseFlipConvex.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-R9946wqht_c/WI3TxYSYjhI/AAAAAAAAA-Q/XRbBwKmx5qYSXLMAlT5ryN8CVopXGI57gCEw/s1600/levyreflectFlip.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-R9946wqht_c/WI3TxYSYjhI/AAAAAAAAA-Q/XRbBwKmx5qYSXLMAlT5ryN8CVopXGI57gCEw/s200/levyreflectFlip.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-dq15y4S1Afk/WJBxfT4QtpI/AAAAAAAABDM/dRGH7rV0I5IR-y4GIftBdVRudBMHpC2WgCLcB/s1600/levyDimensionReflectbFlip.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://3.bp.blogspot.com/-dq15y4S1Afk/WJBxfT4QtpI/AAAAAAAABDM/dRGH7rV0I5IR-y4GIftBdVRudBMHpC2WgCLcB/s320/levyDimensionReflectbFlip.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> </tr></tbody></table><div class="separator" style="clear: both; text-align: left;">The black areas in the top row are obstructions from the looping sections of the Levy curve, they have no colour as you are seeing the wrong side of the line (with flipped convexity too). </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">As you can see, the reflect model seems to give a bit stronger colour, but for both models the overall effect of the concave 'inside' of the Levy curve is a warm colour, and the convex 'outside' of the Levy curve is a colder colour, or much more neutral. It suggests concave is brown, convex is (slightly) blue. The result is also pretty much independent of the length of fractal used, or equally the chosen iteration count. It is also invariant to scaling the fractal by powers of two. </div><div class="separator" style="clear: both; text-align: center;"><br /></div><div><h4></h4><h4>Koch curve</h4></div><div>Because the Koch curve is built from subdivisions that flip direction each iteration, the shape difference at half the wavelength is is either concave or convex depending on the iteration, or equivalently the physical size of the curve. As such, and consistent with the results above, the Koch curve is either brown tinted when the difference is concave, or blue tinted when it is convex. Below I have shown the curve as viewed from above against dimension from 1 to 2 for both 9 (top) and 10 iterations, the double-resolution 10-iteration image is rescaled horizontally, so is the one with half height. </div><table style="width: 100%;"> <tbody><tr> <th><i>Diffuse model</i></th> <th><i>Reflect model</i></th> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-5icasJPG-zc/WI3eVQd8p3I/AAAAAAAAA_A/V6Qe27N1w1YlZC5ZlQ0x4V_87TzpxpEHACLcB/s1600/diffuseColour.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-5icasJPG-zc/WI3eVQd8p3I/AAAAAAAAA_A/V6Qe27N1w1YlZC5ZlQ0x4V_87TzpxpEHACLcB/s200/diffuseColour.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-PBpAwTGsMuA/WI3e7AbuNdI/AAAAAAAAA_Q/ZmGJyly1oykJbgUCMPqP5JsIrbjV9GUGACLcB/s1600/pixelvsdimensionDiffuse.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://1.bp.blogspot.com/-PBpAwTGsMuA/WI3e7AbuNdI/AAAAAAAAA_Q/ZmGJyly1oykJbgUCMPqP5JsIrbjV9GUGACLcB/s320/pixelvsdimensionDiffuse.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-gUKJ_OiBsnQ/WI3jfV-F0kI/AAAAAAAAA_8/BvqHA4dGFT4a4pCOu87lMz2yz7-Uznb-gCLcB/s1600/pixelvsdimensionDiffuseBl.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="62" src="https://3.bp.blogspot.com/-gUKJ_OiBsnQ/WI3jfV-F0kI/AAAAAAAAA_8/BvqHA4dGFT4a4pCOu87lMz2yz7-Uznb-gCLcB/s320/pixelvsdimensionDiffuseBl.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-fbA1bx29tRY/WI3eflG2UdI/AAAAAAAAA_E/R73f4qO4pVMYXvsAJEh-PifL81xk1nCzQCLcB/s1600/shape1reflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-fbA1bx29tRY/WI3eflG2UdI/AAAAAAAAA_E/R73f4qO4pVMYXvsAJEh-PifL81xk1nCzQCLcB/s200/shape1reflect.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-dHShkF1yAOE/WI3fZlRc6gI/AAAAAAAAA_Y/ybzgQF2-pVs7SR7HDIGSe3HKPeLqWCbAACLcB/s1600/pixelvsdimensionReflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://3.bp.blogspot.com/-dHShkF1yAOE/WI3fZlRc6gI/AAAAAAAAA_Y/ybzgQF2-pVs7SR7HDIGSe3HKPeLqWCbAACLcB/s320/pixelvsdimensionReflect.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-R9nnsoqKpaE/WI3jsLv7ZfI/AAAAAAAABAA/vmDPgcxxOvwpbwkpHLz4xtHQlyDjlj5RACLcB/s1600/pixelvsdimensionBl.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="62" src="https://2.bp.blogspot.com/-R9nnsoqKpaE/WI3jsLv7ZfI/AAAAAAAABAA/vmDPgcxxOvwpbwkpHLz4xtHQlyDjlj5RACLcB/s320/pixelvsdimensionBl.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ZFdvS0mPpbg/WI3enV0KvzI/AAAAAAAAA_I/PNTXHZN1d00Hhcg8PNOTcQQZPRf_RkOmQCLcB/s1600/shape2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-ZFdvS0mPpbg/WI3enV0KvzI/AAAAAAAAA_I/PNTXHZN1d00Hhcg8PNOTcQQZPRf_RkOmQCLcB/s200/shape2.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-EUAbaKnOtto/WI3fnFb3wwI/AAAAAAAAA_g/er0MbiKN57EMD96PFrW9kE70yE1S7HjswCLcB/s1600/pixelvsdimensionDiffuseFlip.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://1.bp.blogspot.com/-EUAbaKnOtto/WI3fnFb3wwI/AAAAAAAAA_g/er0MbiKN57EMD96PFrW9kE70yE1S7HjswCLcB/s320/pixelvsdimensionDiffuseFlip.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-AsH37qdS7j8/WI3j39WFJTI/AAAAAAAABAE/-iZRDXIFf2YBDMmr6jUBZ4DntHaRX_iTgCLcB/s1600/pixelvsdimensionDiffuseFlipBl.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="62" src="https://4.bp.blogspot.com/-AsH37qdS7j8/WI3j39WFJTI/AAAAAAAABAE/-iZRDXIFf2YBDMmr6jUBZ4DntHaRX_iTgCLcB/s320/pixelvsdimensionDiffuseFlipBl.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-ZSrE8_OeQ4M/WI3evTbuqkI/AAAAAAAAA_M/bDy9Cd1BiZ8wm73bcxX0TFEyse4-v7NKgCLcB/s1600/shape2reflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://1.bp.blogspot.com/-ZSrE8_OeQ4M/WI3evTbuqkI/AAAAAAAAA_M/bDy9Cd1BiZ8wm73bcxX0TFEyse4-v7NKgCLcB/s200/shape2reflect.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-nkaJDOwog38/WI3fxs4clBI/AAAAAAAAA_k/BwTTJcQQieQ_Wfa2XU_fVjNQeNH-u9N1gCLcB/s1600/pixelvsdimensionFlip.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://4.bp.blogspot.com/-nkaJDOwog38/WI3fxs4clBI/AAAAAAAAA_k/BwTTJcQQieQ_Wfa2XU_fVjNQeNH-u9N1gCLcB/s320/pixelvsdimensionFlip.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-fciqebLV7LA/WI3kK8lZ-JI/AAAAAAAABAM/ROaquSdpbqQAmRnsjVveM34i8TMYkuXiwCLcB/s1600/pixelvsdimensionFlipBl.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="62" src="https://2.bp.blogspot.com/-fciqebLV7LA/WI3kK8lZ-JI/AAAAAAAABAM/ROaquSdpbqQAmRnsjVveM34i8TMYkuXiwCLcB/s320/pixelvsdimensionFlipBl.bmp" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></td></tr></tbody></table>The results for both models are fairly similar, and the results are generally independent of the number of iterations. In all cases the blue Koch curve is a less strong than the brown/red sized curve, this suggests that stochastic curves will have a slightly warm colour.<br /><h4></h4><h4>Dragon Curve</h4><div>This is the simplest case, looking the same on both sides and invariant to doubling the scale. Additionally, the overall colour varies little between the two models. Being 5% extra red at 1.2D and 10% at 1.4D. The lower images span dimension 1 to 2 vertically.</div><table style="width: 100%;"> <tbody><tr> <th><i>Diffuse model</i></th> <th><i>Reflect model</i></th> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Hrt_JRts3iE/WI8Okwif9dI/AAAAAAAABAo/fw933Ke9qLADeGA2Hr3Aq_hSZLEdG9q-wCLcB/s1600/dragondiffuse.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-Hrt_JRts3iE/WI8Okwif9dI/AAAAAAAABAo/fw933Ke9qLADeGA2Hr3Aq_hSZLEdG9q-wCLcB/s200/dragondiffuse.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-IP15iErKexM/WI8OwvUVw9I/AAAAAAAABAs/zLDj8TeyHecYonZyhW7o0gHwxt8bYpRtQCLcB/s1600/dragonDimensionDiffuse.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://2.bp.blogspot.com/-IP15iErKexM/WI8OwvUVw9I/AAAAAAAABAs/zLDj8TeyHecYonZyhW7o0gHwxt8bYpRtQCLcB/s320/dragonDimensionDiffuse.bmp" width="320" /></a></div></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-dERjbLuV27M/WI8O6KdSuII/AAAAAAAABAw/gwcKsyeQI1o9om-VxGbSGNEFUPDJXF4FACLcB/s1600/dragonreflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-dERjbLuV27M/WI8O6KdSuII/AAAAAAAABAw/gwcKsyeQI1o9om-VxGbSGNEFUPDJXF4FACLcB/s200/dragonreflect.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-6SPFhh5PXVQ/WI8PCPtjF4I/AAAAAAAABA0/XBcbpv9KuIsAR55Nxm_jJIANoldDjAYcACLcB/s1600/dragonDimensionReflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://1.bp.blogspot.com/-6SPFhh5PXVQ/WI8PCPtjF4I/AAAAAAAABA0/XBcbpv9KuIsAR55Nxm_jJIANoldDjAYcACLcB/s320/dragonDimensionReflect.bmp" width="320" /></a></div></td> </tr></tbody></table><h4></h4><h4>Random Curve</h4><div>Choosing a random bend direction between (-1,1) gives a colour that is slightly red on average, about 5% more red on both models, beyond about 1.4D. </div><table style="width: 100%;"> <tbody><tr> <th>Diffuse model</th> <th>Reflect model</th> </tr><tr> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-xY_1XdSFjpw/WI8Z-J5YeYI/AAAAAAAABBY/0EjJg1A4LTQ8yniK4Wx9rQ9Xs5QR2PzCwCLcB/s1600/randomDimensionDiffuse.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://3.bp.blogspot.com/-xY_1XdSFjpw/WI8Z-J5YeYI/AAAAAAAABBY/0EjJg1A4LTQ8yniK4Wx9rQ9Xs5QR2PzCwCLcB/s320/randomDimensionDiffuse.bmp" width="320" /></a></div><br /></td> <td><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-cLNrRL_u62s/WI8aGt6vF_I/AAAAAAAABBc/rKXDZV4msvwnLtPntwMWwmVixuZv72UJgCLcB/s1600/randomDimensionReflect.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://2.bp.blogspot.com/-cLNrRL_u62s/WI8aGt6vF_I/AAAAAAAABBc/rKXDZV4msvwnLtPntwMWwmVixuZv72UJgCLcB/s320/randomDimensionReflect.bmp" width="320" /></a></div><br /></td> </tr></tbody></table><h3>Conclusion</h3><div>Both models are very coarse approximations of wave reflection off a fractal curve, but the similarity of results across two lighting models suggests the following results are quite general and probably valid:</div><div><ol><li>concave fractals are brown tinted</li><li>convex fractals are only slightly blue tinted</li><li>due to the asymmetry of above, random curves and dragon curves are slightly brown tinted</li><li>Koch curves are brown or slightly blue tinted, flipping each scale factor of two, and flipping when you look from the other side</li><li>these results are for the extreme case of a bright diffuse sky illuminating a curve with very low reflectance (so that we can ignore secondary reflections). Results will get paler, to white, as the reflectivity increases to 1. </li><li>One can carry most of these results to 3D surfaces, though I imagine that a 1+k dimensional curve will equate closer to 2+<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 17.9200000762939px;">√</span>k dimensions in terms of colour.</li></ol><h3>Coherent light</h3><div>A perhaps more accurate simulation is to look at how a coherent directional light source reflects off the fractal, type 1 at the top of this post. Some <a href="http://www.dgp.toronto.edu/people/stam/reality/Research/pdf/diff.pdf">work has been done on this by Jos Stam</a>, his results indicate that the reflection goes from blue to yellow to white as the fractal roughness increases:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-IRX-39p2Vx4/WJqEF2dougI/AAAAAAAABEQ/RrZH4paJmX0kY8T_okqiw6YSV2ScfhXwACLcB/s1600/frac.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="147" src="https://2.bp.blogspot.com/-IRX-39p2Vx4/WJqEF2dougI/AAAAAAAABEQ/RrZH4paJmX0kY8T_okqiw6YSV2ScfhXwACLcB/s320/frac.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">However, his work uses only a fractal height field, which isn't a proper fractal in that it doesn't have a simple fractal dimension. The high roughness results are unlikely to be accurate. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The approach I take is quite simple, I ignore secondary reflections (accurate if the absorption is high), from the view angle perspective, each point along the fractal that is not in shadow from the light incident angle will have a light travel distance <i>l</i> from light to point to eye. Each colour component (red, green, blue) is the magnitude of the sum of <i>exp(ilf)</i> where <i>f</i> is the frequency of that colour. This is simple interference; an approximation of the <a href="https://en.wikipedia.org/wiki/Kirchhoff_integral_theorem">Kirchhoff integral</a>. </div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-R9qwDXUtanM/WJr8pRLT2oI/AAAAAAAABEo/s15P7J6Lcmc-f_gYxnK4OmNtYz50xiuXgCLcB/s1600/curve.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-R9qwDXUtanM/WJr8pRLT2oI/AAAAAAAABEo/s15P7J6Lcmc-f_gYxnK4OmNtYz50xiuXgCLcB/s200/curve.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">above, the view angle and incident angle are -30 and 30 degrees respectively, and the curve is rotated to the view angle. The visible curve is that seen from the view angle and the black coloured part is in shadow. The light travel length for all the white points is used for the interference. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Unlike Jos Stam's work above, we cannot assume the integration is extended over the full curve as the curve varies everywhere. Instead we have to choose a finite width curve for the interference to act on. This finite size equates to the fact that our eyes can only resolve to a certain resolution (depending on the lens size), and features on the fractal under this 'coherence width' interfere. But this width is an extra parameter. The reflection off a Koch curve therefore has four pertinent parameters, which I map out in the image below. The first two (small coords below) are view angle (y) and incident angle (x). The third coordinate (the 8 rows) is the dimension of the curve, below it varies from 1 (top) to 1.2 (bottom). Notice that the top row is a line along <i>view angle = -incident angle </i>in other words pure reflection of the incoming light. </div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-lLUQywD7Xb0/WJmmtfcpI1I/AAAAAAAABDs/5znY0LEE5TEn8wJEdQUa0V4jltqo_QlTwCLcB/s1600/kochDiscrete2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://2.bp.blogspot.com/-lLUQywD7Xb0/WJmmtfcpI1I/AAAAAAAABDs/5znY0LEE5TEn8wJEdQUa0V4jltqo_QlTwCLcB/s400/kochDiscrete2.bmp" width="400" /></a></div><br />The fourth coordinate (the 8 columns) show different coherence widths from 6x red wavelength up to 48x red wavelength. In <a href="https://www.photonics.ethz.ch/fileadmin/user_upload/pdf/Papers/divitt15a.pdf">this paper</a> the coherence width (as measured by the slit distance that causes the interfering waves to drop to 50%) is shown to go from about 7x sun's main wavelength in foggy/overcast sky to 80x on a clear day, so this corresponds quite well to the range I used.<br />There are clearly different colours in the reflected light, which would show themselves as glistening from a sharp light source. However, from a diffuse sky one must also integrate along any pixel row, and the overall colour on average is warm, with roughly 20% more red than blue.<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-VlzxYBVZcaY/WJmmtYQSeQI/AAAAAAAABDw/3l5i5UV07GUGGB8_DO6nPwO4WyPwL_AJQCLcB/s1600/randomDiscrete.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://3.bp.blogspot.com/-VlzxYBVZcaY/WJmmtYQSeQI/AAAAAAAABDw/3l5i5UV07GUGGB8_DO6nPwO4WyPwL_AJQCLcB/s400/randomDiscrete.bmp" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here we see an equivalent for a random curve. The profiles are a little less clear and asymmetric in the downward diagonal. But it remains the case that the average colour is similarly red-shifted. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Given the diagonal symmetry above for the Koch curve, we don't lose much by looking at just the downward diagonal (view angle = incident angle) and so we can plot the colour against just incident angle (small x) for continuously increasing dimension 1+n^2 for n=0 to 0.5, again each column is for increasing interference width:</div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-idl4cO5Na7k/WLakdqK8zOI/AAAAAAAABFM/tRSEEHuLrikv-iOafEU4nwTjiX6w20heACLcB/s1600/kochDim2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="279" src="https://2.bp.blogspot.com/-idl4cO5Na7k/WLakdqK8zOI/AAAAAAAABFM/tRSEEHuLrikv-iOafEU4nwTjiX6w20heACLcB/s400/kochDim2.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: left;">Note that in this and the diagram above we only look at the few angles where the ray lengths on a flat surface cover an integer number of wavelengths, this prevents colour biases for these small coherence widths. This explains the small (and growing) width of each column. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div>As you can see, the reflections are colourful and show vertical lines that represent angles of high reflection where the angle increases with Koch dimension as expected. The lines have two properties, firstly they fade in an out, probably fading in when the continuous high reflection angle best matches the discrete displayed angles; secondly the line colour cycles through the spectrum with increasing fractal dimension, again as you would expect. Lastly the colours cycle more quickly with increasing dimension for the smaller wavelength light (columns to the right), which due to fractals' scale symmetry represents a wider coherent light wave, or more coherent light, and would give a more sensitive speckling.<br /><br />The vertical lines just to the right of each column give the integration over all incident angles, so the colour of the curve if it were lit by light from all angles. It is less colourful but still varies between warm and cold, however, consistent with above, the average colour is red shifted.<br /><br />The above images use very few view angles to avoid the colour bias, we can also avoid the colour bias by looking at the curve head-on, and can therefore look at a continuous increase in the colour frequency on the x axis, against increasing dimension downwards on the y axis:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-SH604ytmjrQ/WLakqA9CFlI/AAAAAAAABFQ/mKvsZVanD9MOaDXtBclc2ZpxsVA-rI0mQCLcB/s1600/interferenceN.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-SH604ytmjrQ/WLakqA9CFlI/AAAAAAAABFQ/mKvsZVanD9MOaDXtBclc2ZpxsVA-rI0mQCLcB/s200/interferenceN.bmp" width="200" /></a><a href="https://2.bp.blogspot.com/-FGyaPf_XP5k/WLakwK4-lJI/AAAAAAAABFU/g8BmRZE8I9EWx-AX3s_ZuGEDDrLZv_0bgCLcB/s1600/colourInterferenceN.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-FGyaPf_XP5k/WLakwK4-lJI/AAAAAAAABFU/g8BmRZE8I9EWx-AX3s_ZuGEDDrLZv_0bgCLcB/s200/colourInterferenceN.bmp" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">Both images normalise the light wavelength relative to the 'lift height' of the curve for each dimension. The left image shows this directly and you can see the horizontal sinusoidal nature of the reflection intensity with light frequency, naturally this sinusoidal spectral intensity will be seen as a colour of hue that varies with the light frequency (relative to coherence width), on the right this is depicted... one can think of the x axis as now representing an increase in the coherence width (more coherent light).</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">We can also choose to ignore the colour bias from view angle and just display the continuous view angle (x axis) against increasing light frequency (downwards) for five dimensions from roughly 1 to 2. </div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-4BHZ8Y8VjoE/WLalOByuXVI/AAAAAAAABFc/cJbuq0OsHHgBjPPwbrl24r-0w29u50cMQCLcB/s1600/unnormalInterferenceMatrix4.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-4BHZ8Y8VjoE/WLalOByuXVI/AAAAAAAABFc/cJbuq0OsHHgBjPPwbrl24r-0w29u50cMQCLcB/s1600/unnormalInterferenceMatrix4.bmp" /></a></div><div class="separator" style="clear: both; text-align: left;">Notice that as the dimension increases it tends towards two vertical bars (the separation or view angle difference, increasing with dimension). These bars represent the increasingly flat (high reflectance) sides of the Koch curve that becomes a triangle at dimension 2. Intermediate dimensions show speckled patterns that cause both glimmering and colours. Interestingly these appear quite fractal-like in themselves, probably a polar plot would be less distorted.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">All the above were for a single Koch curve patch over the coherence width, which in reality is usually very small. It remains to consider what the macroscopic fractal will look like. We must apply the same interference for all pixels along the width of the macroscopic fractal:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-sXbNZiJRDqU/WMZ5R-wtvYI/AAAAAAAABKg/VcQQm6EGy4I06p_PVSgYSmCBtXCmzdFewCLcB/s1600/interference.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-sXbNZiJRDqU/WMZ5R-wtvYI/AAAAAAAABKg/VcQQm6EGy4I06p_PVSgYSmCBtXCmzdFewCLcB/s1600/interference.png" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Since we can't limit to integer view angles, we choose a different means to avoid colour biasing due to the finite coherent width (which we make about 2 pixel widths), firstly we weight the light contributions to ramp down at both sides of the light beam (a parabola, see bottom of figure below), secondly we make the higher wavelength light have a proportionally higher coherence width, as shown in the figure below. </div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-8xvQaW6Bbk8/WLijpxdx7xI/AAAAAAAABHk/PbDCRNN_Z2sEEwIh6-zcio7JwZ1WInujwCLcB/s1600/wavelengthrays.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://4.bp.blogspot.com/-8xvQaW6Bbk8/WLijpxdx7xI/AAAAAAAABHk/PbDCRNN_Z2sEEwIh6-zcio7JwZ1WInujwCLcB/s320/wavelengthrays.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Below we show such a fractal lit directly head on (left) and lit one radian from the left side (right). for increasing coherence width (downwards) from 1 pixel to 8 pixels. Each column is increasing dimension from 1 (top).</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-IvkWTwaSSmI/WLvu5wbl9rI/AAAAAAAABIM/hh6B2_Zyb4AqKltrwWZCa4ov0Kfc3YBYgCLcB/s1600/rcConWidth.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-IvkWTwaSSmI/WLvu5wbl9rI/AAAAAAAABIM/hh6B2_Zyb4AqKltrwWZCa4ov0Kfc3YBYgCLcB/s200/rcConWidth.bmp" width="194" /></a> <a href="https://4.bp.blogspot.com/-NYip5iyv5kk/WLvu96FeR4I/AAAAAAAABIQ/wKE58zz-XCEhz6Ks4GZWIUi1ZNv0VJo1gCLcB/s1600/rcSideConWidth.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-NYip5iyv5kk/WLvu96FeR4I/AAAAAAAABIQ/wKE58zz-XCEhz6Ks4GZWIUi1ZNv0VJo1gCLcB/s200/rcSideConWidth.bmp" width="194" /></a></div><div class="separator" style="clear: both; text-align: left;">The result is that the coherence width makes almost no difference to the colour of the fractal. As expected the fractal is more blurry with a larger width and for very small width (hardly any coherence) the colour tends to white. Average colours are shown down the right hand line, and you can see they are very consistent. One can also see that the fractal colour changes greatly with dimension, and varies a little across the length of the fractal. </div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-t78riWz7d_E/WLvuqoCX0UI/AAAAAAAABH8/AUjjwhmYXZoJC9qJNo6QJnQb7akDbHE4gCLcB/s1600/rcAmbientConWidth.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://2.bp.blogspot.com/-t78riWz7d_E/WLvuqoCX0UI/AAAAAAAABH8/AUjjwhmYXZoJC9qJNo6QJnQb7akDbHE4gCLcB/s320/rcAmbientConWidth.bmp" width="311" /></a></div><div class="separator" style="clear: both; text-align: left;">Above is the average over 20 light angles, so for an ambient white sky. The colour is much less pronounced however you can still see a definite change in the hue with increasing dimension, and the colour strength increases with higher dimension, though the fractal also becomes darker. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Given that the coherence width makes little difference, what if we use a fixed width (say 2 pixels) and increased the scale of the fractal? here's what happens for a point light source, head on (left) and 1 radian from the left side (right):</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ZUl-2eL4aJs/WLvuxoqS1yI/AAAAAAAABIE/ywkYveZ2_hsZrN2Z1_uajx47cvcy317twCLcB/s1600/rc.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://2.bp.blogspot.com/-ZUl-2eL4aJs/WLvuxoqS1yI/AAAAAAAABIE/ywkYveZ2_hsZrN2Z1_uajx47cvcy317twCLcB/s200/rc.bmp" width="194" /></a> <a href="https://3.bp.blogspot.com/-yNGf3kb8AtU/WLvuuOWg3yI/AAAAAAAABIA/nVMR1vC5Gfs4FY1hiT4hFT4kRWCfQpfKwCLcB/s1600/rcSide.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-yNGf3kb8AtU/WLvuuOWg3yI/AAAAAAAABIA/nVMR1vC5Gfs4FY1hiT4hFT4kRWCfQpfKwCLcB/s200/rcSide.bmp" width="194" /></a></div><div class="separator" style="clear: both; text-align: left;">In both cases we see a hue cycling with curve scale (y axis) and an increase in the cycle density with increasing dimension (lower rows). This matches the result from the first section of this post, where blue vs red tinted Koch curves toggle as the iteration order increments (equivalent to increasing size). The above is just more realistic as it has a more correct frequency ratio between blue and red light (rather than 2) and it includes green light properly. </div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-Kz6twkBTKYY/WL07oklyw0I/AAAAAAAABIo/fEpSaC2_MKUQaK_MZJaZ2ILD1qYTe4WsQCLcB/s1600/rcAmbient.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://3.bp.blogspot.com/-Kz6twkBTKYY/WL07oklyw0I/AAAAAAAABIo/fEpSaC2_MKUQaK_MZJaZ2ILD1qYTe4WsQCLcB/s320/rcAmbient.bmp" width="311" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">The ambient white sky (above) also shows this hue cycling, but the colour is more grey, particularly for low dimension curves. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">We can also copy this method for the other fractals:</div><div class="separator" style="clear: both; text-align: left;">Levy convex (left) and concave (right):</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-gE3C_jkcf04/WL074uTNQkI/AAAAAAAABIs/zOakPISjfIkNiwkSaTXFLVAXHRmJJ0ZCACLcB/s1600/levyAmbient.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-gE3C_jkcf04/WL074uTNQkI/AAAAAAAABIs/zOakPISjfIkNiwkSaTXFLVAXHRmJJ0ZCACLcB/s200/levyAmbient.bmp" width="193" /></a><a href="https://3.bp.blogspot.com/-Ttu3KFdq81g/WL079hOprFI/AAAAAAAABIw/Ep56h_8o7q4p7WSS2PMbzxmeTePzM7pwwCLcB/s1600/levyFlipAmbient.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://3.bp.blogspot.com/-Ttu3KFdq81g/WL079hOprFI/AAAAAAAABIw/Ep56h_8o7q4p7WSS2PMbzxmeTePzM7pwwCLcB/s200/levyFlipAmbient.bmp" width="193" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Dragon (left) and random (right):</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-3Y6iXpirxZU/WL08PImGluI/AAAAAAAABI4/PpvlwNirH6c-i91Zo-YMcz3OkW83mFv4gCLcB/s1600/dragonAmbient.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://1.bp.blogspot.com/-3Y6iXpirxZU/WL08PImGluI/AAAAAAAABI4/PpvlwNirH6c-i91Zo-YMcz3OkW83mFv4gCLcB/s200/dragonAmbient.bmp" width="194" /></a><a href="https://4.bp.blogspot.com/-oOt3QlHlvZU/WL08TzTTbCI/AAAAAAAABI8/0rbZm-dakoYx5qvg7Mj7ryEcgnYugXG6wCLcB/s1600/randomAmbient.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://4.bp.blogspot.com/-oOt3QlHlvZU/WL08TzTTbCI/AAAAAAAABI8/0rbZm-dakoYx5qvg7Mj7ryEcgnYugXG6wCLcB/s200/randomAmbient.bmp" width="194" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here's a spinning Koch snowflake which combines ambient light with a point light source from the right hand side:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-CCkrp04N-Gs/WND3se51lTI/AAAAAAAABLc/OzMMbtZ_tyUZPAaUp-m_U9l7GVKt4NTigCLcB/s1600/kochslit.gif.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://2.bp.blogspot.com/-CCkrp04N-Gs/WND3se51lTI/AAAAAAAABLc/OzMMbtZ_tyUZPAaUp-m_U9l7GVKt4NTigCLcB/s320/kochslit.gif.gif" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">and here it is without the point light, so just directional light. Notice that the vertical spectrum flips every 30 degrees, so browns become purple/blue and visa versa. This exactly matches the observation in methods 1 and 2 in the first section of such a flip when viewing the curve from inside compared to outside. This is because a 30 degree turn is equivalent to seeing the curve from the opposite direction. This is a very interesting property of the Koch curve.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-qEt6XjvJgCo/WND37BHFPmI/AAAAAAAABLg/qUMDmQT3wbYEU7Mrd0PtRRL03j_Nxv6jQCLcB/s1600/koch7samples.gif.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://1.bp.blogspot.com/-qEt6XjvJgCo/WND37BHFPmI/AAAAAAAABLg/qUMDmQT3wbYEU7Mrd0PtRRL03j_Nxv6jQCLcB/s320/koch7samples.gif.gif" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">and finally, here's another attempt with a wider spot size for a large scale Koch snowflake with a stronger point light, it shows the much more dramatic colouring you get from coherent light sources:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-gtwLFi5iYdE/WMPchkATiZI/AAAAAAAABJs/3WcyJe62w5wj7fxuzY6XnNkGn_RNu_ijACLcB/s1600/www.GIFCreator.me_udQtoR.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://4.bp.blogspot.com/-gtwLFi5iYdE/WMPchkATiZI/AAAAAAAABJs/3WcyJe62w5wj7fxuzY6XnNkGn_RNu_ijACLcB/s320/www.GIFCreator.me_udQtoR.gif" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">By comparison, here are the gifs for the levy curve and dragon curve respectively, just ambient and lit, click for larger versions:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-OoWWmCn1G8s/WNEHXAiJxyI/AAAAAAAABMM/jDR4FNG0Mf82bdSJJKF-x7ugeCKEzFihgCLcB/s1600/levy.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://1.bp.blogspot.com/-OoWWmCn1G8s/WNEHXAiJxyI/AAAAAAAABMM/jDR4FNG0Mf82bdSJJKF-x7ugeCKEzFihgCLcB/s200/levy.gif" width="200" /></a><a href="https://1.bp.blogspot.com/-oj_eO5_HjDI/WND4uXiHoEI/AAAAAAAABLs/rv6Au6hlBwwoMxK4QM9M5eYbj7Lboc_oQCLcB/s1600/levylit.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="65" src="https://1.bp.blogspot.com/-oj_eO5_HjDI/WND4uXiHoEI/AAAAAAAABLs/rv6Au6hlBwwoMxK4QM9M5eYbj7Lboc_oQCLcB/s200/levylit.gif" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">dragon curve:</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Zkr3mSULVzQ/WND5EPVQU0I/AAAAAAAABLw/2hOshezYkJwqMJNk7pwDvPu0JhwwkR7igCLcB/s1600/dragon.gif.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://4.bp.blogspot.com/-Zkr3mSULVzQ/WND5EPVQU0I/AAAAAAAABLw/2hOshezYkJwqMJNk7pwDvPu0JhwwkR7igCLcB/s200/dragon.gif.gif" width="200" /></a><a href="https://2.bp.blogspot.com/-izs2vizbdFc/WND5NmWyKHI/AAAAAAAABL0/06ocWQJpRm0dtrvdLATN4o9ZVWyVT2XDACLcB/s1600/dragonlit.gif.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://2.bp.blogspot.com/-izs2vizbdFc/WND5NmWyKHI/AAAAAAAABL0/06ocWQJpRm0dtrvdLATN4o9ZVWyVT2XDACLcB/s200/dragonlit.gif.gif" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><h4 style="clear: both; text-align: left;">Conclusions for Coherence Approach</h4><div><ul><li>The first three diagrams seem to confirm the previous general conclusion that a red-shift seems to be the average shift for a Koch curve as well as a random curve. </li><li>The idea that the Koch curve hue cycles with its scale is consistent in all the above examples.</li><li>colour is more prominent as the fractal dimension increases</li><li>colour is more prominent on single point light sources, and less on more spread out light sources. </li><li>In all cases, the hue varies more with curve scale (where it fully cycles) and with increasing dimension, and less so along the length of the Koch curve.</li><li>The last figure shows that colours are stronger in the hollows... this is because the incident light angle range is less, so it is closer to the point light source case. This is consistent with the first section where the concave Levy curve shows stronger colour than the convex one. </li></ul></div><div><h2>Overall Conclusion</h2></div><div>The three versions of light dynamics suggest the following strongly:</div><div><ol><li>coloration increases with curve dimension but brightness decreases</li><li>coloration increases (but brightness decreases) with decreasing reflectivity</li><li>most fractals of moderate dimension will be quite dark compared to smooth surfaces, so coloration is most likely visible under strong light</li><li>coloration increases with more pointlike light sources, but is still noticeable for ambient white light. Therefore coloration is stronger in concave areas.</li><li>coloration is not really effected by coherence width (how wide the area where interference occurs), only reduces for very small width.</li><li>hue cycles with scale of the Koch curve (first sections suggest it doesn't really do this for Levy curves)</li></ol></div><div class="separator" style="clear: both; text-align: left;">The code for the latter images is available at: <a href="https://github.com/TGlad/FractalColour2D">https://github.com/TGlad/FractalColour2D</a> </div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">A more concise summary is given here: <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/what-colour-are-fractals">https://sites.google.com/site/tomloweprojects/scale-symmetry/what-colour-are-fractals</a>.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">I'll finish with some more well known fractal curves, now in colour:</div><div class="separator" style="clear: both; text-align: left;">Minkowski sausage:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-tZgIMq-MJe0/WNuJm2hWaGI/AAAAAAAABMo/s9utcBlu9DALpaTtXeWo0aQ-utMPmHMlwCLcB/s1600/minkowskisausage.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://4.bp.blogspot.com/-tZgIMq-MJe0/WNuJm2hWaGI/AAAAAAAABMo/s9utcBlu9DALpaTtXeWo0aQ-utMPmHMlwCLcB/s200/minkowskisausage.gif" width="200" /></a><a href="https://4.bp.blogspot.com/-xR3ATslUWcI/WNuJ7NvexvI/AAAAAAAABMs/s-0M51qZnNEtMSJnt29h1vGr52Cvj3XZgCLcB/s1600/mikowskisausagelit.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://4.bp.blogspot.com/-xR3ATslUWcI/WNuJ7NvexvI/AAAAAAAABMs/s-0M51qZnNEtMSJnt29h1vGr52Cvj3XZgCLcB/s200/mikowskisausagelit.gif" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">Minkowski mushroom: (I made up the name):</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-f_6TqjJuVpM/WNxCr0oyxUI/AAAAAAAABN8/VD9I0-C2PKAbJ0inb9SMwupZ1XVKXXC7ACLcB/s1600/minkowskimushroom.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://1.bp.blogspot.com/-f_6TqjJuVpM/WNxCr0oyxUI/AAAAAAAABN8/VD9I0-C2PKAbJ0inb9SMwupZ1XVKXXC7ACLcB/s200/minkowskimushroom.gif" width="200" /></a><a href="https://3.bp.blogspot.com/-fVMnKdmp1RU/WNxMp_PFQNI/AAAAAAAABOM/O2AoS2kUHvQCWqojW30xrYYhWCCrf04GQCLcB/s1600/minkowskimushroomlit.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://3.bp.blogspot.com/-fVMnKdmp1RU/WNxMp_PFQNI/AAAAAAAABOM/O2AoS2kUHvQCWqojW30xrYYhWCCrf04GQCLcB/s200/minkowskimushroomlit.gif" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">Vicsek fractal:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-h86HEzM-F8Y/WNuOSAuRuqI/AAAAAAAABNE/Sy56cU1szZQayNdAJyGekX6J5bZBOSr5wCLcB/s1600/vicsek.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://1.bp.blogspot.com/-h86HEzM-F8Y/WNuOSAuRuqI/AAAAAAAABNE/Sy56cU1szZQayNdAJyGekX6J5bZBOSr5wCLcB/s200/vicsek.gif" width="200" /></a><a href="https://3.bp.blogspot.com/-DLEVVFcD6UQ/WNuLPAYGJNI/AAAAAAAABM0/N5zDYgSqvW04JlercLy_Fk0RUkSgnFwGQCLcB/s1600/vicseklit.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="66" src="https://3.bp.blogspot.com/-DLEVVFcD6UQ/WNuLPAYGJNI/AAAAAAAABM0/N5zDYgSqvW04JlercLy_Fk0RUkSgnFwGQCLcB/s200/vicseklit.gif" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><br /></div><ol></ol></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com1tag:blogger.com,1999:blog-8438916308834541294.post-89209948245755657372016-12-22T18:04:00.000-08:002017-01-29T02:32:50.310-08:00The Colour of 3D FractalsAn interesting feature of 3D fractals compared to other shapes is that they have a real colour. By this I mean that, if you 3D printed a 3D fractal to an ultrafine scale (below about 100nm), using a white substance, the fractal would never-the-less appear to have some amount of colour. This is due to <a href="https://en.wikipedia.org/wiki/Structural_coloration" target="_blank">structural coloration</a>, meaning that the actual shape of an object (rather than its chemistry / pigments) gives it colour.<br /><br />Examples in nature include butterfly wings, peacock's tail feathers, the iridescent colours when cutting through meat (due to muscle fibre ends), and opals. These iridescent effects occur when the object has a regular structure at scales similar to light's wavelength, much like a diffraction grating. But it isn't just iridescent colours that are produced structurally, for instance the bright blue colours of parrots are due to the fine scale shape of the feathers.<br /><br />So what colour are 3D fractals? What colour is a 3D <a href="https://en.wikipedia.org/wiki/Menger_sponge">Menger sponge</a>, or a <a href="https://sites.google.com/site/mandelbox/">Mandelbox</a> or <a href="http://www.skytopia.com/project/fractal/mandelbulb.html">Mandelbulb</a>? The answer is that it is pretty difficult to find out. The equations of light scattering are quite complicated, and also difficult to simulate as calculations and reflections happening at the nanoscale effect the result at the macroscopic scale (to colour a 1cm fractal for instance). One needs to get statistical approximations of the light dynamics, luckily <a href="https://www.researchgate.net/profile/A_Cherny/publications" target="_blank">A Yu Cherny</a> and <a href="https://www.researchgate.net/profile/Eugen_Anitas/publications" target="_blank">E M Anitas</a> from the Moscow Institute of Physics have some very recent papers on this subject. In <a href="https://arxiv.org/pdf/1507.07376.pdf" target="_blank">this paper</a> they look at the spectrum of light reflected from a cluster fractal, in this case a Cantor cluster:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-WqdKeFMvlTw/WFx4JWdWtFI/AAAAAAAAA60/Yp-UkLrBBEgGrNFCuqI6UvOu7GZgGKSpgCLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A03%253A16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-WqdKeFMvlTw/WFx4JWdWtFI/AAAAAAAAA60/Yp-UkLrBBEgGrNFCuqI6UvOu7GZgGKSpgCLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A03%253A16.png" /></a></div><div class="separator" style="clear: both; text-align: left;">gives the spectrum:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-R-H0k2JN6m8/WFx4Pv76vDI/AAAAAAAAA64/ERJiBfqjXOkPLpKln7_lCaqZYeX16z9qACLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A02%253A29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://2.bp.blogspot.com/-R-H0k2JN6m8/WFx4Pv76vDI/AAAAAAAAA64/ERJiBfqjXOkPLpKln7_lCaqZYeX16z9qACLcB/s320/Screenshot%2Bfrom%2B2016-12-23%2B11%253A02%253A29.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">The horizontal axis qL is proportional to the frequency of light, and the vertical axis gives relative intensity of reflected light. The downwards slope suggests that this fractal would be a blueish sort of colour, since it has a similar slope to classic <a href="https://en.wikipedia.org/wiki/Rayleigh_scattering" target="_blank">Rayleigh scattering</a> which gives the sky its blue colour. </div><div class="separator" style="clear: both; text-align: left;">They also <a href="https://arxiv.org/pdf/1609.09699.pdf" target="_blank">work out the spectral response</a> of a Koch snowflake-like 2D fractal (from in-plane light rays), with a similar power-law downward slope, but less steep in this case. And also <a href="http://journals.aps.org/pre/pdf/10.1103/PhysRevE.84.036203" target="_blank">for 3D Viscek fractsls</a> (void trees):</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-MKQf6kUbLvs/WFx7QFbgm8I/AAAAAAAAA7Q/e4TuHBD2JwAAdky11aIWswrzlARQs9pzACLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A17%253A04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-MKQf6kUbLvs/WFx7QFbgm8I/AAAAAAAAA7Q/e4TuHBD2JwAAdky11aIWswrzlARQs9pzACLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A17%253A04.png" /></a></div><div class="separator" style="clear: both; text-align: left;">giving the spectrum:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-7ey32VyUyGo/WFx7VWwBrlI/AAAAAAAAA7U/r2amcVHDCRwVMnHmgyVLYXuiRoqV-PWvQCLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A17%253A34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://2.bp.blogspot.com/-7ey32VyUyGo/WFx7VWwBrlI/AAAAAAAAA7U/r2amcVHDCRwVMnHmgyVLYXuiRoqV-PWvQCLcB/s320/Screenshot%2Bfrom%2B2016-12-23%2B11%253A17%253A34.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">which again has a gentler slope, so I would expect it to be a less saturated blue, if I'm interpreting it correctly. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">For more complex fractals statistical plots are no good as the colour could well change with location. A good example is the <a href="https://sites.google.com/site/mandelbox/" target="_blank">Mandelbox fractal</a> (I'm using scale -1.5), where some areas are clearly more rough than others. To render the fractal, I use the program <a href="http://syntopia.github.io/Fragmentarium/" target="_blank">Fragmentarium</a> as the algorithm can be modified. There are several effects that could be simulated but I have tried just two:</div><div class="separator" style="clear: both; text-align: left;"></div><ol><li>These fractals are rendered as a very high detail but smooth surface, which is controlled by the minDist bailout threshold, so long as the other iteration counts are high. I model light of different wavelengths as reacting to this surface of different minDist values respectively, consequently high wavelength light will only react to smoothed features and low wavelength light will reflect off all the smaller features. So I simply render the fractal three times using a different minDist, for red green and blue light respectively. </li><li>The <a href="https://en.wikipedia.org/wiki/Bragg%27s_law" target="_blank">Bragg's Law</a> effect shows how a coherent light, when bouncing off two surfaces of different depths, interferes on the return journey, either destructively (darker in that wavelength) or constructively (brighter in that wavelength). This is the principle effect happening in the iridescent natural examples. I simulate it by taking nearby points in screen-space, and performing this interference based on their relative depths. </li></ol>The result is shown on this 1cm dimension Mandelbox, there appears to be no coloration:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-ZZqEDZs26hI/WFyBDl8gNYI/AAAAAAAAA78/CShfAwKczusrNvJGQ7YtnmuZV30V_j8CACLcB/s1600/col1cmdirect.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://4.bp.blogspot.com/-ZZqEDZs26hI/WFyBDl8gNYI/AAAAAAAAA78/CShfAwKczusrNvJGQ7YtnmuZV30V_j8CACLcB/s320/col1cmdirect.png" width="318" /></a></div><div class="separator" style="clear: both; text-align: left;">However this may be largely expected on this fractal as most of it is very low roughness surfaces (even the rough parts have a lot of these flat box faces, larger than the wavelengths of light). But if we look closer: </div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-fCx4KSih4hc/WFyAynR-NbI/AAAAAAAAA70/z7jnPQ_5ZS41Jrz2krX5XTBLfXSGgEiZACLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A37%253A04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="286" src="https://2.bp.blogspot.com/-fCx4KSih4hc/WFyAynR-NbI/AAAAAAAAA70/z7jnPQ_5ZS41Jrz2krX5XTBLfXSGgEiZACLcB/s320/Screenshot%2Bfrom%2B2016-12-23%2B11%253A37%253A04.png" width="320" /></a></div> here we see a brown colour on the thinnest cracks, and come blue colours amoungst the rougher areas.<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-3FqUpFZo9qw/WFyAys8XMbI/AAAAAAAAA74/kDVOr1tj7Wwlqv3geWgrwYbcTYecC6HXQCLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A38%253A10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="315" src="https://1.bp.blogspot.com/-3FqUpFZo9qw/WFyAys8XMbI/AAAAAAAAA74/kDVOr1tj7Wwlqv3geWgrwYbcTYecC6HXQCLcB/s320/Screenshot%2Bfrom%2B2016-12-23%2B11%253A38%253A10.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">This 'lilly' shows a brown coloration at its edge, and blue amoung the tiny encrusted boxes.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-Ge8l0W1kaUA/WFyAyZQK2xI/AAAAAAAAA7w/ZDuMy_E2QcEVCEiotOJSIE7Xf-Z5SgpuACLcB/s1600/Screenshot%2Bfrom%2B2016-12-23%2B11%253A39%253A59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://2.bp.blogspot.com/-Ge8l0W1kaUA/WFyAyZQK2xI/AAAAAAAAA7w/ZDuMy_E2QcEVCEiotOJSIE7Xf-Z5SgpuACLcB/s320/Screenshot%2Bfrom%2B2016-12-23%2B11%253A39%253A59.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">For a smaller (4mm) Mandelbox, the effect is a bit stronger, but the actual colours haven't changed. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Examining the effect of the two simulated effects above, it appears that they have a very similar effect, both causing the redder and the bluer areas in roughly the same places. Since the 2nd effect is slower and less obvious in its correctness, I have chosen to exclude it, and can just do the first effect, but exaggerating the wavelength difference between red,green,blue to compensate. This is done in real-time using this Fragmentarium <a href="https://drive.google.com/open?id=0B8S7Si-yu3DoU0RQV211MVVpTVU" target="_blank">script</a>. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">It is important when using this script to turn the 'pigment' colour off (colourIterations=0), antialiasScale=0, dither=0, and set maxRaySteps and (Mandelbox) Iterations to high. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here is the result for the 1cm Mandelbox:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-0W8gh2PFBxQ/WFyBftkbsII/AAAAAAAAA8A/l1qCQAkgbaEU2eHMOjubtmYZEY-ym_i3wCLcB/s1600/rgb1cm5x5-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://2.bp.blogspot.com/-0W8gh2PFBxQ/WFyBftkbsII/AAAAAAAAA8A/l1qCQAkgbaEU2eHMOjubtmYZEY-ym_i3wCLcB/s400/rgb1cm5x5-2.png" width="371" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div>How about the 1cm Mandelbulb? Well, the same code gives this:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-9h6GpZjp5pU/WFyHQD7s7uI/AAAAAAAAA8k/eHZvc6bYQ_kad7PYQRMFt1tljKwzD6MZACLcB/s1600/mandelbulb-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://4.bp.blogspot.com/-9h6GpZjp5pU/WFyHQD7s7uI/AAAAAAAAA8k/eHZvc6bYQ_kad7PYQRMFt1tljKwzD6MZACLcB/s400/mandelbulb-2.png" width="372" /></a></div><div class="separator" style="clear: both; text-align: left;">One problem with this method is that, while the large minDist lighting gives the expected smoothing, it also enlarges the fractal. consequently, edges could become coloured as they are only seen in the lower wavelengths. The images below removed this effect, and I have also rendered in higher detail, with more colour channels (5), and adjusted the specularity to see what effect it had:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://drive.google.com/file/d/0B8S7Si-yu3DoalVJOWtBN0lyRUU/view?usp=sharing" target="_blank">mandelbox</a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://drive.google.com/file/d/0B8S7Si-yu3DodHZzQVVET2Z3SE0/view?usp=sharing" target="_blank">mandelbulb</a></div><div class="separator" style="clear: both; text-align: left;">The results are very similar, and suggest that the colours in the images are not unwanted effects. Here are two areas of the -1.5 mandelbox that show consistent colds and warm colours respectively:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-0Mf75jsmHxM/WGMKbgtbR7I/AAAAAAAAA9I/Nw9Ubg7LbbQxWPVrWFfsefB5eWVXA0LsACLcB/s1600/testblue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://3.bp.blogspot.com/-0Mf75jsmHxM/WGMKbgtbR7I/AAAAAAAAA9I/Nw9Ubg7LbbQxWPVrWFfsefB5eWVXA0LsACLcB/s1600/testblue.png" /></a> <a href="https://2.bp.blogspot.com/-ZHk04rZYCHI/WGMKfNv65tI/AAAAAAAAA9M/5VjcnUca74wxKAEIDPIAB8SxMrHykbnogCLcB/s1600/testwarm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-ZHk04rZYCHI/WGMKfNv65tI/AAAAAAAAA9M/5VjcnUca74wxKAEIDPIAB8SxMrHykbnogCLcB/s1600/testwarm.png" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">These results are all very primitive however, so my conclusions are really just conjectures at this point, here they are:</div><div class="separator" style="clear: both; text-align: left;"><br /></div></div>1. For a surface of increasing roughness, the surface goes from a mirror towards a reducing sharpness specular component and increasing diffuse component, the specular component is a warmer colour and the diffuse a cooler colour. This is very similar to the <a href="https://en.wikipedia.org/wiki/Tyndall_effect">Tyndall effect</a>, but rather than scattering of light going through a 'dust' it is scattered reflections off surfaces. The colour gets stronger as roughness increases.<br />2. For much rougher surfaces, areas in the light and protrusions have a warmer colour as the higher frequencies are scattered away. and areas out of the light and in hollows and away from the specular reflection have a bluer colour as greater scattering is needed to get light from these areas.<br />3. For materials that absorb some of the incident light, I would expect the average colour to be warmer, as blues scatter more and so have more surface hits where absorption can happen. <br /><div><div class="separator" style="clear: both;">4. For complex fractals the structural colour can be quite subtle, because:</div><div class="separator" style="clear: both;"> a. the coloration varies so much that it averages to a greyish colour</div><div class="separator" style="clear: both;"> b. many surfaces are low roughness, such as the -1.5 mandelbox, or the smooth mandelbulb areas</div></div><div class="separator" style="clear: both;">5. For complex (multifractal, varying scale) fractals the structural colour doesn't effectively change with the scale of the fractal. It just effects how noticeable it is. </div><div><br />Regarding point 1, a good avenue here may be the <a href="https://en.wikipedia.org/wiki/Specular_highlight">Cook-Torrence model</a> of specular reflection off rough surfaces, it includes a Fresnel term, which includes a term to the power of the wavelength, such that larger wavelengths give a stronger, sharper specular reflection, consistent with this point 1.<br /><br />Update:<br />There is a nice article on <a href="https://www.osapublishing.org/oe/abstract.cfm?uri=oe-21-26-31919">3D printing transmission gratings</a> at the micrometre level. This may be a reasonable model for the 2.5D fractal here:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-BsdeKmfYV74/WBxrVSajocI/AAAAAAAAA48/ubW-6oWN7-gAqzhlFhACXhl7oXphHQsOQCPcB/s1600/squarerender.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://3.bp.blogspot.com/-BsdeKmfYV74/WBxrVSajocI/AAAAAAAAA48/ubW-6oWN7-gAqzhlFhACXhl7oXphHQsOQCPcB/s320/squarerender.png" width="320" /></a></div>as it is somewhat similar in its shape. If this is the case, then unfortunately the low pillar height in this fractal places it off the graph in figure 2, but the extrapolation hints at a pale or aqua blue, when the pillar height is 1 micrometre. Perhaps a better paper is <a href="https://www.researchgate.net/publication/234877298_High_angular_tolerant_color_filter_using_subwavelength_grating">this</a>, which has a very similar local shape. For pillar height 120nm the perceived colour was 530nm which is aqua. Moreover, they claim that this lower pillar height (the same as the pillar width) keeps its colour up to 45 degrees angle, which, given the shape of the fractal above, suggest that the whole thing would keep an aqua colour, rather than be too iridescent. However it should be noted that both papers use transparent material and the result probably depends on the relative refraction indices... so it doesn't necessarily hold that the same coloration would work with just a reflective material like metal. <br /><br />Also a lab has in fact made a nanoscale 'sponge' fractal, which they call the fractal nanotruss:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-MxSHorghHis/WI3Dwd1YtXI/AAAAAAAAA9o/pZuBY0vzlX0WMCjl50JrIBORtFDeSKLXACLcB/s1600/fractal_nanotruss.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://2.bp.blogspot.com/-MxSHorghHis/WI3Dwd1YtXI/AAAAAAAAA9o/pZuBY0vzlX0WMCjl50JrIBORtFDeSKLXACLcB/s320/fractal_nanotruss.jpg" width="320" /></a></div>As you can see, the smallest scale is around 500nm, so just about into the light wavelengths. The lead of this project has clarified that it does exhibit structural colour, she says it shows opalescence. So it is good to hear that the effect does happen in real examples... though it remains a question what effect the material properties has on the resulting colour. </div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com1tag:blogger.com,1999:blog-8438916308834541294.post-69462072029222670342016-11-03T03:34:00.000-07:002017-03-29T17:42:24.166-07:00Semi-dimensional shapes and other curvesI just discovered that shapes with half-integer dimensions have a simple square construction by subdividing by 4. An example is labelled the <a href="https://en.wikipedia.org/wiki/File:Quadratic_Koch_curve_type2_iterations.png" target="_blank">quadratic type 2 curve</a> (or sometimes Minkowski sausage) with dimension 1.5. However this curve comes in a left and right handed form. Another example I made here:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-aIU2-FVwXLE/WNxURFHtIGI/AAAAAAAABOc/FnIYs9xDVKMfNeh-j5HqrwW8Tfvigu5QACLcB/s1600/mushroom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="73" src="https://4.bp.blogspot.com/-aIU2-FVwXLE/WNxURFHtIGI/AAAAAAAABOc/FnIYs9xDVKMfNeh-j5HqrwW8Tfvigu5QACLcB/s320/mushroom.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-fiy2urMPsFU/WBhiW-GNaCI/AAAAAAAAA3Y/2fEKN4Gl3eIXdAb55uC0qpA3M_yr8AhrQCLcB/s1600/square1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://3.bp.blogspot.com/-fiy2urMPsFU/WBhiW-GNaCI/AAAAAAAAA3Y/2fEKN4Gl3eIXdAb55uC0qpA3M_yr8AhrQCLcB/s400/square1.png" width="400" /></a></div>It is also possible to build 2.5D surfaces, an example is <a href="https://en.wikipedia.org/wiki/File:Quadratic_Koch_3D_(type2_stage2).png" target="_blank">here</a>, however this surface intersects. It is possible to make a non-intersecting surface, which is approximately a 3D version of the above:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-DIUNaXc9bpM/WBxrKHQ9bGI/AAAAAAAAA4s/VR86XcUXBJsi4i7_Qj2-kIkJ2H3xCtabACLcB/s1600/squareits1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="163" src="https://3.bp.blogspot.com/-DIUNaXc9bpM/WBxrKHQ9bGI/AAAAAAAAA4s/VR86XcUXBJsi4i7_Qj2-kIkJ2H3xCtabACLcB/s200/squareits1.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-eRjmRe2rCJw/WBxrOdSB2HI/AAAAAAAAA4w/9D6rDpTGFf4xQRuBAepzbEko8oM4apTEQCLcB/s1600/squareits2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://1.bp.blogspot.com/-eRjmRe2rCJw/WBxrOdSB2HI/AAAAAAAAA4w/9D6rDpTGFf4xQRuBAepzbEko8oM4apTEQCLcB/s200/squareits2.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-BsdeKmfYV74/WBxrVSajocI/AAAAAAAAA40/A8y7sXbU53Qe4Ec4RK2owrZZH_7bdnGxgCLcB/s1600/squarerender.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://3.bp.blogspot.com/-BsdeKmfYV74/WBxrVSajocI/AAAAAAAAA40/A8y7sXbU53Qe4Ec4RK2owrZZH_7bdnGxgCLcB/s320/squarerender.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: left;">And here's a 1.5D curve in 3D space:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-7KcSZdGE5XM/WB2_S2OojdI/AAAAAAAAA5Y/YvSE0TQvMB8bTrsTJnQxjQMsNnKehfaYACLcB/s1600/curve1pt51.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="https://3.bp.blogspot.com/-7KcSZdGE5XM/WB2_S2OojdI/AAAAAAAAA5Y/YvSE0TQvMB8bTrsTJnQxjQMsNnKehfaYACLcB/s200/curve1pt51.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-0KQTVSDYrZM/WB2_Sw1NshI/AAAAAAAAA5U/E3u6Digl-7UKO-FbrOIJbsYWjFTOv-4mQCLcB/s1600/curve1pt52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="135" src="https://3.bp.blogspot.com/-0KQTVSDYrZM/WB2_Sw1NshI/AAAAAAAAA5U/E3u6Digl-7UKO-FbrOIJbsYWjFTOv-4mQCLcB/s200/curve1pt52.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-hvWdDKHyaTM/WB2_K2ZqrxI/AAAAAAAAA5Q/HTgZlax2jBMw8RUXuxob87EPIWwuCYCPACLcB/s1600/curverender1pt5png.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://1.bp.blogspot.com/-hvWdDKHyaTM/WB2_K2ZqrxI/AAAAAAAAA5Q/HTgZlax2jBMw8RUXuxob87EPIWwuCYCPACLcB/s320/curverender1pt5png.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">A 2.5D curve in 3D space is a bit more of a challenge</div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-56068409231340505782016-09-19T04:58:00.002-07:002016-10-24T19:46:57.207-07:00Crumpled surface fractalsWhen we say a rope is 3m long, we have in mind a metre as a straight line, and when we say our garden is 60m^2, the m^2 is a solid flat square. The line and the square are archetype examples of the measures of length and area respectively. When we measure the size of a curve between dimension 1 and 2, a sensible archetype is the variable angle Koch curve. The bend angle exemplifies a rough curve of any dimension between 1 and 2.<br /><br />When it comes to rough surfaces there appears to be no useful archetype, parametrised by dimension. I give some good candidates for such an archetype <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/measuring-things-with-fractals" target="_blank">here</a>.<br /><br />An interesting alternative is a fractal surface that is a non-smooth developable surface, so has zero Gaussian curvature (or, technically, its discrete equivalent) everywhere and could be made out of paper (if self intersection were allowed). It is not immediately obvious how to generate fractals that have this property.<br /><br />The trick is to note that a Koch curve itself can be built from a sequence of corrugations, each twice the size of the previous, and we can perform these corrugations using reflections on the surface, which maintain the curvature (or discrete equivalent of curvature) of zero. One can then apply this to a surface by doing the corrugations in two directions:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-FLrK4pKpr8s/V9_MXgGm0-I/AAAAAAAAAuQ/THOaxfOk7-EASVTIylD4MwcyyrmLRSN_QCLcB/s1600/foil%2Biterations.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="204" src="https://2.bp.blogspot.com/-FLrK4pKpr8s/V9_MXgGm0-I/AAAAAAAAAuQ/THOaxfOk7-EASVTIylD4MwcyyrmLRSN_QCLcB/s640/foil%2Biterations.png" width="640" /></a></div>Each iteration we pitch the surface by the bend angle, reflect in two horizontal planes to produce corrugations, then rotate the surface by the yaw angle, which is 90 degrees in this case. Above we see the first five iterations.<br /><br />The bend angle is variable, giving a range of dimensions from 2 up to some value less than three:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-McOi6cy-nrw/V9_NJi1PwSI/AAAAAAAAAuU/ccTOWh_qdKoOKfx2PHcG3AG9jYcqGtJ8gCLcB/s1600/foil%2Bbend%2Bangles.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://1.bp.blogspot.com/-McOi6cy-nrw/V9_NJi1PwSI/AAAAAAAAAuU/ccTOWh_qdKoOKfx2PHcG3AG9jYcqGtJ8gCLcB/s640/foil%2Bbend%2Bangles.png" width="640" /></a></div>Notice that the fractal is built of multiple square spirals. Here we see bend angles π/24, π/12, π/8 and π/6. It is not known at what point the surface begins to intersect, it could be any angle > 0, but visually, there seems to be little in the way of intersection, even at π/6, which is a nice feature to have in the main.<br />close ups for bend angle π/12:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-xVPB79qm1gQ/V-Jy9KlYDkI/AAAAAAAAAyA/cmOgZYDhnQg92JcsXzKQtmWUTcD3jp8aACLcB/s1600/crumple1a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="444" src="https://1.bp.blogspot.com/-xVPB79qm1gQ/V-Jy9KlYDkI/AAAAAAAAAyA/cmOgZYDhnQg92JcsXzKQtmWUTcD3jp8aACLcB/s640/crumple1a.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-ppp9S2aY_o0/V-JzD7zzHxI/AAAAAAAAAyE/2uJtqWdKHRAjg1K2jccPZ5fKNxt3TmTDACLcB/s1600/crumple1b.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="264" src="https://3.bp.blogspot.com/-ppp9S2aY_o0/V-JzD7zzHxI/AAAAAAAAAyE/2uJtqWdKHRAjg1K2jccPZ5fKNxt3TmTDACLcB/s640/crumple1b.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br />Apart from the bend angle, there are multiple yaw angles possible:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-B-uKh_C_fpg/V9_O2kEEuWI/AAAAAAAAAug/QZClWNMGl4MeSV1sAXGxSQ9JeyFspbQ5gCLcB/s1600/foil%2Byaw%2Bangles%2B2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="196" src="https://1.bp.blogspot.com/-B-uKh_C_fpg/V9_O2kEEuWI/AAAAAAAAAug/QZClWNMGl4MeSV1sAXGxSQ9JeyFspbQ5gCLcB/s640/foil%2Byaw%2Bangles%2B2.png" width="640" /></a></div>yaw angle = π on the left gives an extruded Koch curve (reflected at the mid point), π/2 is my chosen default surface seen above, π/3 gives hexagonal spirals, and on the right is π*2/3 which seems quite similar.<br />A close up of these triangular patterns:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-do0GGU3u08k/V9_PgD-8BTI/AAAAAAAAAuo/9oiDaTshbYonv9NBjikDqITWbwqTcXrPQCLcB/s1600/foil%2Byaw%2Bangles%2B3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="272" src="https://2.bp.blogspot.com/-do0GGU3u08k/V9_PgD-8BTI/AAAAAAAAAuo/9oiDaTshbYonv9NBjikDqITWbwqTcXrPQCLcB/s640/foil%2Byaw%2Bangles%2B3.png" width="640" /></a></div>These look slightly less regular than the square pattern, so more like crumpled up foil. If we want a randomised crumple a good choice is π/phi (the golden ratio):<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-3wDwGGy2yQk/V9_Qr6G_kwI/AAAAAAAAAu4/umh_g-AsAqk0Fuh9NNEmYKgbvAdqntHJACEw/s1600/foil%2Bgolden1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="268" src="https://2.bp.blogspot.com/-3wDwGGy2yQk/V9_Qr6G_kwI/AAAAAAAAAu4/umh_g-AsAqk0Fuh9NNEmYKgbvAdqntHJACEw/s320/foil%2Bgolden1.png" width="320" /></a></div>While it still shows a bit of a pattern, this is because we are looking at the centre point (0,0,0), if we picked an arbitrary square section of the surface it would give a good resemblance to crumpled paper:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-ph1gdr3_HYo/V-BG2s2yScI/AAAAAAAAAvg/rn64O6SwUdM-yBihMDI1sfha7W4RKakTACLcB/s1600/foil%2Bgolden2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="234" src="https://1.bp.blogspot.com/-ph1gdr3_HYo/V-BG2s2yScI/AAAAAAAAAvg/rn64O6SwUdM-yBihMDI1sfha7W4RKakTACLcB/s320/foil%2Bgolden2.png" width="320" /></a></div>Therefore the family of fractal surfaces defined by the yaw angle (and bend angle) generalise the Koch curve, polygonal spiral crumples and a random crumpled surface. And the bend angle allows any level of crumpling.<br /><br />To my knowledge this is the first fractal developable surface, and could make for a simple and useful archetype for rough surfaces in nature. Unlike the <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/measuring-things-with-fractals" target="_blank">previous ones I have given</a>, this surface has no hills or troughs and so is more like a tree of ridges and a tree of valleys, which is quite a good model for many landscapes, it also seems to be quite a good description for rough rocky surfaces and of course crumpled paper.<br /><br />If we define the bend angle as φ and the yaw angle as θ, then generation algorithm is as follows, starting with a flat sheet spanning (-0.5,-0.5,0) to (0.5,0.5,0):<br /><ol><li><b>yaw</b> around origin by θ degrees</li><li>φ degrees</li><li>calculate scale s so concertinas are multiples (harmonics) along the same axis: <a href="https://3.bp.blogspot.com/-hfgqMrsy3oI/V-CcJwlQLJI/AAAAAAAAAv8/FR4NDEW-x9EuxGRX7T_Z0xNbfEZH9DEWgCLcB/s1600/CodeCogsEqn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="23" src="https://3.bp.blogspot.com/-hfgqMrsy3oI/V-CcJwlQLJI/AAAAAAAAAv8/FR4NDEW-x9EuxGRX7T_Z0xNbfEZH9DEWgCLcB/s200/CodeCogsEqn.png" width="200" /></a></li><li><b>scale</b> (dilate) around origin by s</li><li><b>reflect</b> around the horizontal planes (0,0,m) and (0,0,-m) to concertina the surface, where <a href="https://2.bp.blogspot.com/-2lKtbuKFC8A/V-CeUB48c8I/AAAAAAAAAwM/94mxxSNHpvUo2EhrSX3-jOyQrCB8oqXHwCLcB/s1600/CodeCogsEqn%2B%25282%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://2.bp.blogspot.com/-2lKtbuKFC8A/V-CeUB48c8I/AAAAAAAAAwM/94mxxSNHpvUo2EhrSX3-jOyQrCB8oqXHwCLcB/s1600/CodeCogsEqn%2B%25282%2529.png" /></a>and i is the iteration count, giving larger concertinas each iteration. <i>k</i> controls how large the smallest concertina is.</li><li><b>go to 1.</b> until nothing is being reflected.</li></ol><div>The calculation of <i>s</i> requires some explanation. What we want is for the concertina for a given horizontal axis to have the same length (so the same number of bends) when we return to that axis, i.e. after a turn of 180 degrees. If it has the same length then the formula for <i>m</i> will ensure that subsequent concertinas will be exactly double then quadruple the size etc. These are called octaves, and a consequence of using precise octaves is that the fractal folds are the same across the surface. The calculation of <i>s</i> is simple for integer divisions of π, but for non-integer θ the function <i>s(</i><i>θ</i>) is not continuous, and in the general case, for irrational numbers the exponent of <i>s</i> is 2/π.<br /><br />Note that, while various yaw angles are possible, only the default, π/2 gives a simple mesh for all bend angles.<br />A simple mesh means that for any given maximum concertina size, the mesh is a repeating lattice (a tiling).<br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-wv_nSKBbZZg/V-X3q5N90-I/AAAAAAAAAy8/4lrY9KfE70sdqNCOhh-qIA8PLFsmkjUNgCLcB/s1600/iterations.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="88" src="https://1.bp.blogspot.com/-wv_nSKBbZZg/V-X3q5N90-I/AAAAAAAAAy8/4lrY9KfE70sdqNCOhh-qIA8PLFsmkjUNgCLcB/s640/iterations.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">This fold map shows the folds up to the first 7 iterations. We can also view how the fold map changes with bend angle:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-A93EpomvGK8/V-X4ENtm16I/AAAAAAAAAzA/cfHoRsEqSloPpA7gUNic9b1XQiq9cYxawCLcB/s1600/foldanglechange.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://3.bp.blogspot.com/-A93EpomvGK8/V-X4ENtm16I/AAAAAAAAAzA/cfHoRsEqSloPpA7gUNic9b1XQiq9cYxawCLcB/s320/foldanglechange.png" width="319" /></a></div><div class="separator" style="clear: both; text-align: left;">In this case the shade goes from light to dark from bend angle π/36 to 8π/36 (almost maximum). The small corrugations seem to vary surprisingly little with bend angle but the final large corrugations seem to vary most.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-f1OfeQ8zW2g/V-ugrVM5cCI/AAAAAAAAA0Q/oBseKvAlo9YOzTlUEQTN-1ysGud5rEwnACLcB/s1600/blenderb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://3.bp.blogspot.com/-f1OfeQ8zW2g/V-ugrVM5cCI/AAAAAAAAA0Q/oBseKvAlo9YOzTlUEQTN-1ysGud5rEwnACLcB/s640/blenderb.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">Here is a render in Blender, for bend angle 15 degrees, where the centre of yaw is the bottom right corner. Which is equivalent to just looking at an offset patch of the fractal, from (0,0) to (1,1). Notice that the bottom edge is a Koch curve of bend angle 15 degrees (but with out of plane bends to the curve). The right edge is also this Koch curve. The fractal square spirals are also less obvious in this picture. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">From these renderings it is clear that self intersection does take place at least in the 15 degree case, and most likely for all bend angles > 0. In the 15 degree case the overlap only seems to account for about 0.1% of the landscape area, and increases for larger bend angles. Therefore this fractal is immersed in 3D space, but not embedded within it. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><a href="https://2.bp.blogspot.com/-6U0mqXCV6fw/V-ukjLZd4FI/AAAAAAAAA0k/tNexvyWbL4sImKtP1uXJ4bBOCwDRRpsaACLcB/s1600/blenderc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="426" src="https://2.bp.blogspot.com/-6U0mqXCV6fw/V-ukjLZd4FI/AAAAAAAAA0k/tNexvyWbL4sImKtP1uXJ4bBOCwDRRpsaACLcB/s640/blenderc.png" width="640" /></a><span style="text-align: left;">Here's bend angle 22.5. Can you spot the self intersection?</span></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">It is a bit hard getting a good sense of depth, both depth-of-field and fog reduce the quality. Here I try adding four different coloured local light sources and I think it helps to distinguish the depth. For bend angle from 0 to 22.5 degrees:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-Kv222kBAgtY/V-zj8F1goEI/AAAAAAAAA08/neBy-iyaAawHcUhjgLNnuEsBFRZNgGkBACLcB/s1600/bendangle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-Kv222kBAgtY/V-zj8F1goEI/AAAAAAAAA08/neBy-iyaAawHcUhjgLNnuEsBFRZNgGkBACLcB/s1600/bendangle.png" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Although the actual folding of the triangle mesh is quite complicated as the iterations build up, the actual fold curve on the piece of paper tends to a constant shape, which when not doing the largest corrugations is a repeating curve. The single repeating pattern looks like this for a 7.5 degree bend angle:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-vqcslmYXK88/V-z1VksVhoI/AAAAAAAAA1U/ARA-RezFW3grjq9v3jB9fIVqOaLCeZo8QCLcB/s1600/foldshape.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="161" src="https://1.bp.blogspot.com/-vqcslmYXK88/V-z1VksVhoI/AAAAAAAAA1U/ARA-RezFW3grjq9v3jB9fIVqOaLCeZo8QCLcB/s320/foldshape.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">So as the iterations increase all folds look like some repetition of this on the flat paper.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The Hausdorff dimension D is a function of the bend angle φ:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-ZwOLyWwrIpk/V-2gqVwNecI/AAAAAAAAA1s/tSrAnHwWNJcy8eCT2Y9tyhYKrUoVn4OJACLcB/s1600/CodeCogsEqn%2B%25286%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-ZwOLyWwrIpk/V-2gqVwNecI/AAAAAAAAA1s/tSrAnHwWNJcy8eCT2Y9tyhYKrUoVn4OJACLcB/s1600/CodeCogsEqn%2B%25286%2529.png" /></a></div><div class="separator" style="clear: both; text-align: left;">So the surface has dimension 2 when the bend angle is 0, and dimension 3 when it is 45 degrees, which is equivalent to the maximum bend (dimension 2) Koch curve on each axis. Since the surface has overlap, some of the 'volume' of such a surface is due to the overlap, just like a dimension 2 Levy curve.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Since the shape derives from a flat surface it is possible to texture the surface, here is an example using the golden ratio yaw angle and a random location, to give a crumpled look:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-IFXv4T2RL4E/V_TcHdg4BMI/AAAAAAAAA2M/5wbNA1L2KKgPqTiLSz1SH1EjNbhzXB3TgCLcB/s1600/crumpledtexture2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://1.bp.blogspot.com/-IFXv4T2RL4E/V_TcHdg4BMI/AAAAAAAAA2M/5wbNA1L2KKgPqTiLSz1SH1EjNbhzXB3TgCLcB/s400/crumpledtexture2.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The code for this is available on <a href="https://github.com/TGlad/CrumpleSurface">https://github.com/TGlad/CrumpleSurface</a>, it generates a .ply file. </div><div class="separator" style="clear: both; text-align: left;">The executable is <a href="https://drive.google.com/file/d/0B8S7Si-yu3Doa19yNy1MaTRPdkU/view?usp=sharing" target="_blank">here</a>, run with -h for help, and example meshes here:</div><div class="separator" style="clear: both; text-align: left;"> <a href="https://drive.google.com/file/d/0B8S7Si-yu3DoZXRWOVBCZVg5YWM/view?usp=sharing" target="_blank">bend angle 15 degrees</a></div><div class="separator" style="clear: both; text-align: left;"> <a href="https://drive.google.com/file/d/0B8S7Si-yu3DoUWU1TVdXYUlhSzg/view?usp=sharing" target="_blank">bend angle 30 degrees</a>.</div>This shape is also compared with other variable dimension surfaces <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/measuring-things-with-fractals" target="_blank">here</a>, and in this <a href="https://www.researchgate.net/publication/309391846_Three_Variable_Dimension_Surfaces" target="_blank">article</a>.<br /><br />Finally, here's a little sequence of random meshes going from 7.5 bend angle up to 30 degrees, with some forest texture and a road:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-0qyhPur1dZQ/V_d9Rwy6t-I/AAAAAAAAA2o/4FVFs_GYCEMaDbeFQXaZFc_k_YzlflC7QCLcB/s1600/forest5f.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://3.bp.blogspot.com/-0qyhPur1dZQ/V_d9Rwy6t-I/AAAAAAAAA2o/4FVFs_GYCEMaDbeFQXaZFc_k_YzlflC7QCLcB/s320/forest5f.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-xqFwBhpS7Os/V_d9e46YJBI/AAAAAAAAA2s/7NfPHhf6uwc1s7dkv5A-gAG8-FmZe8R5wCLcB/s1600/forest5e.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://4.bp.blogspot.com/-xqFwBhpS7Os/V_d9e46YJBI/AAAAAAAAA2s/7NfPHhf6uwc1s7dkv5A-gAG8-FmZe8R5wCLcB/s320/forest5e.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-dexeLX8v3Zw/V_d9uEzUh-I/AAAAAAAAA2w/tO0lX-oI_AQwQ6pjnDSjXzoyzJ8G3tvyACLcB/s1600/forest5c.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://1.bp.blogspot.com/-dexeLX8v3Zw/V_d9uEzUh-I/AAAAAAAAA2w/tO0lX-oI_AQwQ6pjnDSjXzoyzJ8G3tvyACLcB/s320/forest5c.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-d7bWde7-xq0/V_d92_VEFNI/AAAAAAAAA20/1BbpPeilIW0EQU8RX71B6aS8iDvM2HamACLcB/s1600/forest5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://4.bp.blogspot.com/-d7bWde7-xq0/V_d92_VEFNI/AAAAAAAAA20/1BbpPeilIW0EQU8RX71B6aS8iDvM2HamACLcB/s320/forest5.png" width="320" /></a></div>The rainforest effect works quite well with the rougher meshes. This whole technique is potentially quite useful for computer games because it uses a square texture without any distortion. For 90 degree yaw angles at least the shape tiles, along with the texture. In addition lower and higher detail versions are inherent and share the same properties. The downside is the self intersections happen, but at least with the random location case (like above) you can try out different random seeds to minimise this. </div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-35792285702000796822015-03-02T02:15:00.002-08:002015-03-16T03:16:40.314-07:00Conformal transforms in Minkowski spaceI'm writing this mainly for my record, the question is what does a conformal transformation of Minkowski space look like?<br />The reason it is an interesting question is that relativistic physics is based on Minkowski space (or distorted versions) and the most fundamental symmetry of this is conformal symmetry.<br /><br />The answer is a combination of:<br /><br /><ul><li>translations</li><li>scales</li><li>rotations</li><li>boosts</li><li>inversions (which invert the distance metric (positive or negative), so flip around the double hyperboloid in the time-like region and around the hyperboloid of revolution in the space-like region).</li></ul><div>However, this isn't totally useful as it doesn't give a clear image of your average conformal transformation. For comparison, we can define any arbitrary conformal transformation of 3d Euclidean space as:</div><div><br /></div><div>An arbitrary rotation around an arbitrary circle in space. </div><div><br /></div><div>This covers all cases, sometimes in degenerate form, for example an ordinary rotation is when the circle has infinite radius, an ordinary translation is the limit as the radius increases, the circle becomes farther away and the rotation around it decreases.</div><div><br /></div><div>The equivalent definition for 3+1 Minkowski space can be described in two ways, in terms of linear operations (e.g. rotations, boosts) or in terms of curvature. In both cases the transform is described in the time-like region when it involves a time flip, and in the space-like region when it involves a space flip:</div><blockquote><b>Linear</b> </blockquote><blockquote>Space-like:<br /><i>An arbitrary rotation around an arbitrary circle in space, with equal and opposite arbitrary boosts through the circle at two times around an arbitrary point in time.</i> </blockquote><blockquote>Time-like:<br /><i>An arbitrary boost through an arbitrary sphere in space at an arbitrary point in time. </i></blockquote><blockquote><b>Curvilinear</b> </blockquote><blockquote>Space-like:<br /><i>An arbitrary cupping (positive curvature) of space together with an arbitrary (boost) acceleration through the axis of the bulge.</i> </blockquote><blockquote>Time-like:<br /><i>An arbitrary radial expansion/contraction at an arbitrary point in space and time.</i></blockquote><div>I'm still not sure if this covers all combinations of transforms but it seems close at least. It is a nice and simple generalisation of 'rotation around a circle' for space-like regions and 'boost through a plane' for time-like regions. </div><div><br /></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-83524627852723374402015-02-15T19:17:00.001-08:002015-02-19T00:29:33.022-08:00Tetrahedral wrapping function<div class="separator" style="clear: both; text-align: center;">A useful result of mapping complex numbers to the <a href="http://en.wikipedia.org/wiki/Riemann_sphere" target="_blank">Riemann sphere</a> is that elementary functions like z^2 and z^3 can be interpreted geometrically. </div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-GNSMNxklk34/VOE_JlanfzI/AAAAAAAAAhQ/4ktQnWdrQsQ/s1600/Spherical_henagonal_hosohedron.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-GNSMNxklk34/VOE_JlanfzI/AAAAAAAAAhQ/4ktQnWdrQsQ/s1600/Spherical_henagonal_hosohedron.png" height="197" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">z^2 wraps the sphere around onto itself, take the one faced spherical polyhedron shown above, cut it along the shown arc and stretch it around itself, as if doubling the longitude coordinates, until you can sew it back up at the original cut. The space naturally pinches toward the two poles such that the transform remains conformal. This is z^2.</div><div class="separator" style="clear: both; text-align: left;">Similary, z^3 takes the two-faced spherical polyhedron and wraps it around onto itself, as if stretching the complex plane by tripling the longitude around for example the Greenwich meridian.</div><div style="text-align: left;"><a href="http://2.bp.blogspot.com/-7bEDk7eBa9k/VOE_JlYxJJI/AAAAAAAAAhU/T9z-Pa11PjY/s1600/Spherical_digonal_hosohedron.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-7bEDk7eBa9k/VOE_JlYxJJI/AAAAAAAAAhU/T9z-Pa11PjY/s1600/Spherical_digonal_hosohedron.png" height="200" width="190" /></a></div><div style="text-align: left;">z^4 wraps a three-faced spherical polyhedron onto itself, and z^5 wraps a four-faced spherical polyhedron onto itself. These shapes are all called <a href="http://en.wikipedia.org/wiki/Hosohedron" target="_blank">hosohedra</a>. </div><div style="text-align: left;"><a href="http://2.bp.blogspot.com/-yWY0RgGshek/VOE_Kfnlh9I/AAAAAAAAAh0/HxTsE_CWfGo/s1600/Spherical_trigonal_hosohedron.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-yWY0RgGshek/VOE_Kfnlh9I/AAAAAAAAAh0/HxTsE_CWfGo/s1600/Spherical_trigonal_hosohedron.png" height="200" width="199" /></a><a href="http://3.bp.blogspot.com/-nvWZMTNNiCI/VOE_JryZMmI/AAAAAAAAAhY/3tzw939A-Mw/s1600/Spherical_square_hosohedron.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-nvWZMTNNiCI/VOE_JryZMmI/AAAAAAAAAhY/3tzw939A-Mw/s1600/Spherical_square_hosohedron.png" height="195" width="200" /></a></div><div style="text-align: left;">Given this interpretation, it is interesting to consider mappings that wrap other spherical polyhedra onto themselves. Afterall, while the first two example hosohedra are regular, the three and four faced ones are not. The four faced hosohedra is also an unstable partition of the sphere in some senses, the stable and regular four faced spherical polyhedron is a spherical tetrahedron:</div><div style="text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-osMu4jpH7xo/VOHC9QgStWI/AAAAAAAAAkA/LhriHHymEA8/s1600/tetra.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-osMu4jpH7xo/VOHC9QgStWI/AAAAAAAAAkA/LhriHHymEA8/s1600/tetra.gif" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">So it is interesting that you can indeed wrap a spherical tetrahedron onto itself, and it does remain conformal. The function is this:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-pTfmijROVYw/VOFItHuKeqI/AAAAAAAAAiI/FuxBBnfqN18/s1600/CodeCogsEqn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-pTfmijROVYw/VOFItHuKeqI/AAAAAAAAAiI/FuxBBnfqN18/s1600/CodeCogsEqn.png" height="82" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">If the complex plane origin is point D in the above image than the constants in the numerator of the product are the vertices A,B and C. The constants in the denominator are the poles which map to the centre of the spherical triangle ABC, they are located at the centre of the three remaining spherical triangles. </div><div class="separator" style="clear: both; text-align: left;">The mapping can be visualised on the complex plane using David Bau's <a href="http://davidbau.com/conformal/#-0.25*(2%5E0.5)*(z*(z-2%5E0.5)*(z-(-0.5%2B0.866*i)*2%5E0.5)*(z-(-0.5-0.866*i)*2%5E0.5))%2F((z-(0.5%5E0.5)*(0.5%2B0.866*i))*(z-(0.5%5E0.5)*(0.5-0.866*i))*(z-(0.5%5E0.5)*(-1)))" target="_blank">complex function viewer</a>:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-O1oXQ_3QLIo/VOFdovpimHI/AAAAAAAAAi0/6gH8SyL1q08/s1600/Screenshot%2Bfrom%2B2015-02-16%2B13%3A01%3A19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-O1oXQ_3QLIo/VOFdovpimHI/AAAAAAAAAi0/6gH8SyL1q08/s1600/Screenshot%2Bfrom%2B2015-02-16%2B13%3A01%3A19.png" height="403" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;">The grey circles are the unit disk in the complex plane, so you can see that this function can equally be seen to map a two sided spherical polyhedra (the the edge being the unit disk) to a spherical octahedron.</div><div class="separator" style="clear: both; text-align: left;">This animation I made shows the fold as applied to a non-spherical tetrahedron:</div><br /><div class="separator" style="clear: both; text-align: center;"><object width="320" height="266" class="BLOG_video_class" id="BLOG_video-563a4fe6ed954a00" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="movie" value="https://www.youtube.com/get_player"><param name="bgcolor" value="#FFFFFF"><param name="allowfullscreen" value="true"><param name="flashvars" value="flvurl=https://redirector.googlevideo.com/videoplayback?id%3D563a4fe6ed954a00%26itag%3D5%26source%3Dblogger%26requiressl%3Dyes%26app%3Dblogger%26cmo%3Dsecure_transport%3Dyes%26cmo%3Dsensitive_content%3Dyes%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1500368605%26sparams%3Dip,ipbits,expire,id,itag,source,requiressl%26signature%3D77C8025D03C772DB18C99941B26111B12404D9A0.B00734F7B7CD999E01070EC112198F8AF98C1FFF%26key%3Dck2&iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D563a4fe6ed954a00%26offsetms%3D5000%26itag%3Dw160%26sigh%3DSuv1YATeIeezUMBZPaGiRuVHJuo&autoplay=0&ps=blogger"><embed src="https://www.youtube.com/get_player" type="application/x-shockwave-flash" width="320" height="266" bgcolor="#FFFFFF" flashvars="flvurl=https://redirector.googlevideo.com/videoplayback?id%3D563a4fe6ed954a00%26itag%3D5%26source%3Dblogger%26requiressl%3Dyes%26app%3Dblogger%26cmo%3Dsecure_transport%3Dyes%26cmo%3Dsensitive_content%3Dyes%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1500368605%26sparams%3Dip,ipbits,expire,id,itag,source,requiressl%26signature%3D77C8025D03C772DB18C99941B26111B12404D9A0.B00734F7B7CD999E01070EC112198F8AF98C1FFF%26key%3Dck2&iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D563a4fe6ed954a00%26offsetms%3D5000%26itag%3Dw160%26sigh%3DSuv1YATeIeezUMBZPaGiRuVHJuo&autoplay=0&ps=blogger" allowFullScreen="true" /></object></div><br /><div class="separator" style="clear: both;">This tetrahedral wrapping function, for which I'll use the letter tau, can be simplified slightly if we allow it to wrap onto its dual tetrahedron (so removing the minus sign) and rearrange slightly to:</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-y6kiOLeuSRc/VOFSNNskpEI/AAAAAAAAAik/mw_6QLoUz8s/s1600/CodeCogsEqn%2B(2).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-y6kiOLeuSRc/VOFSNNskpEI/AAAAAAAAAik/mw_6QLoUz8s/s1600/CodeCogsEqn%2B(2).png" height="76" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div>The mandelbrot set of this function requires care to visualise, unlike the standard mandelbrot set it doesn't bailout on large values. The only parts not in the set are those that hit a pole and so remain at infinity, you can do this by iterating the radius of the pixel, not just the point, and bailing out when either of the three poles are within this radius. Here I view it using <a href="http://hirnsohle.de/test/fractalLab/" target="_blank">Fractal Lab</a>:<br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-FW8m3CrlaFI/VORkHbbsG7I/AAAAAAAAAk0/KfGUwfe_3XY/s1600/tetra1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-FW8m3CrlaFI/VORkHbbsG7I/AAAAAAAAAk0/KfGUwfe_3XY/s1600/tetra1.png" height="155" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-VNCG-090ZAs/VORkSoOyFcI/AAAAAAAAAk8/jz5UC6GGnvE/s1600/tetra2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-VNCG-090ZAs/VORkSoOyFcI/AAAAAAAAAk8/jz5UC6GGnvE/s1600/tetra2.png" height="157" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-9jUmgMa5_Eg/VORkcWhLOPI/AAAAAAAAAlE/ZA84wDabtWc/s1600/tetra3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-9jUmgMa5_Eg/VORkcWhLOPI/AAAAAAAAAlE/ZA84wDabtWc/s1600/tetra3.png" height="128" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;">I find the look of this fractal to be quite different to others, even though you can clearly see mandelbrot elements within it. Here is part of the negative tau version:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-iUIjCySHmWI/VOWe126FreI/AAAAAAAAAmA/6jzWxjgKQsI/s1600/negativeTetrahedral.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-iUIjCySHmWI/VOWe126FreI/AAAAAAAAAmA/6jzWxjgKQsI/s1600/negativeTetrahedral.png" height="157" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><br /></div>You can also apply this function as a form of Mandelbulb fractal. In this case the transform operates on a real cartesian sphere around the origin, and the radius or each point squares each iteration, the mandelbrot version gives:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-rgmXmVusnjg/VOG5uGuBzzI/AAAAAAAAAjE/oBVP5SFsc0k/s1600/tetrahedralFractal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-rgmXmVusnjg/VOG5uGuBzzI/AAAAAAAAAjE/oBVP5SFsc0k/s1600/tetrahedralFractal.png" height="287" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">which was rendered using <a href="http://blog.hvidtfeldts.net/index.php/2013/09/fragmentarium-version-1-0-cologne-released/" target="_blank">Fragmentarium</a>.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><h3 style="clear: both; text-align: left;">Dihedral version</h3><div>While the above function is I think quite unique as a regular polyhedron that wraps onto itself, it is also possible to do so with a two-sided spherical polyhedron called a <a href="http://en.wikipedia.org/wiki/Dihedron" target="_blank">Dihedron</a> {4,2} (which means four vertices and two faces):</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-bJfXmaMimDc/VOMG2PUnXEI/AAAAAAAAAkQ/fAenFIef1wI/s1600/Tetragonal_dihedron.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-bJfXmaMimDc/VOMG2PUnXEI/AAAAAAAAAkQ/fAenFIef1wI/s1600/Tetragonal_dihedron.png" height="200" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">The wrap is similar to taking a square (with two sides, like an envelope) and folding in half then in half again to form a smaller square, but in our case it is done on the inflated/spherical surface.</div><div class="separator" style="clear: both; text-align: left;">The function is:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-wQUPX7bvyiQ/VOMIiBDdfyI/AAAAAAAAAkc/eJGFoOvfM48/s1600/CodeCogsEqn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-wQUPX7bvyiQ/VOMIiBDdfyI/AAAAAAAAAkc/eJGFoOvfM48/s1600/CodeCogsEqn.png" height="46" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">Which can be visualised <a href="http://davidbau.com/conformal/#2*z*(z-1)*(z%2B1)%2F((z%2Bi)%5E2*(z-i)%5E2)" target="_blank">here</a>. You can visualise the mandelbrot set of it by using its reciprocal:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-NJXh7u-Y5Gw/VORpE8TDZQI/AAAAAAAAAlQ/_o1ZLsicQV8/s1600/dihedral1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-NJXh7u-Y5Gw/VORpE8TDZQI/AAAAAAAAAlQ/_o1ZLsicQV8/s1600/dihedral1.png" height="200" width="145" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-sOJX0TU5A-o/VORpKNd0hHI/AAAAAAAAAlY/dDGta6zaxAk/s1600/dihedral2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-sOJX0TU5A-o/VORpKNd0hHI/AAAAAAAAAlY/dDGta6zaxAk/s1600/dihedral2.png" height="198" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-M7m5S__jgQ0/VORpSIM4DvI/AAAAAAAAAlg/QaN5wNFZoT0/s1600/dihedral3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-M7m5S__jgQ0/VORpSIM4DvI/AAAAAAAAAlg/QaN5wNFZoT0/s1600/dihedral3.png" height="156" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-V4uAy0_jJuA/VORpcsVu-zI/AAAAAAAAAlo/ucvg3ngfqkc/s1600/diheral4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-V4uAy0_jJuA/VORpcsVu-zI/AAAAAAAAAlo/ucvg3ngfqkc/s1600/diheral4.png" height="154" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;">Wow, these are great pics.. and the negative version:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-mH9BHqDqBoE/VOWelvLrzgI/AAAAAAAAAl4/2x01rECOqf8/s1600/negativeDihedral.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-mH9BHqDqBoE/VOWelvLrzgI/AAAAAAAAAl4/2x01rECOqf8/s1600/negativeDihedral.png" height="159" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">It also produces a mandelbulb which has some similarities to the tetrahedral version:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-lWBADKeZDus/VOMJHsdWsWI/AAAAAAAAAkk/2Uqg6OxjeF4/s1600/dihedrabulb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-lWBADKeZDus/VOMJHsdWsWI/AAAAAAAAAkk/2Uqg6OxjeF4/s1600/dihedrabulb.png" height="236" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div><br /></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-72812566457026610202014-10-31T14:34:00.002-07:002014-12-22T16:08:22.115-08:00Lorentz invariant latticesIn a <a href="http://tglad.blogspot.com.au/2013/02/relativistic-automata-continued-ii.html" target="_blank">previous post</a> I was looking at relativistic cellular automata, which requires grid data structures that are invariant to boosts, in addition to their discrete translation and rotation invariance. The method I used worked in 1+1 Minkowski space-time, and sort of worked in 2+1 space-time, boosts in 3 directions were fine, but the intermediate direction boosts caused unwanted dilation of the cells.<br /><br />Since then I have discovered two techniques which work properly. More broadly than cellular automata, these 'Minkowski lattices' would be useful ways to order data in any simulation that is relativistic, and probably serve as good 'toy' models for quantum field theory or dynamics such as gas models under special relativity. Existing gas models typically have Lorents invariance emerging at large scales, in fact many sites imply that Lorentz invariance is impossible on lattices.<br /><br />This is somewhat intuitive as a continued Lorentz boost will squash lattice points unendingly down one diagonal axis, so one might expect any lattice to become irrevoquably squashed in this lattice and so cannot maintain its finite point separation. However, as this clip shows, it is in fact possible:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-MD4UMywYaDI/VE0H4v8y2tI/AAAAAAAA12A/Pfs83PQT3QY/s346/LorentzianLattice.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-MD4UMywYaDI/VE0H4v8y2tI/AAAAAAAA12A/Pfs83PQT3QY/s346/LorentzianLattice.gif" height="320" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">Though I am mainly interested in 3+1 space-time rather than this 1+1 example..</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The main trick is to ensure that no lattice points ever touch the light cone (t<sup>2</sup> = x<sup>2</sup> + y<sup>2</sup> + z<sup>2</sup>), since such points will indeed get bunched up.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The first method comes from <a href="http://authors.library.caltech.edu/21357/1/Boozer2010p12202Am_J_Phys.pdf" target="_blank">this 2010 paper</a>, it provides several possible configurations but the main one has basis lattice vectors (t,x,y,z) as: </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">(√3,0,0,0)</div><div class="separator" style="clear: both; text-align: left;">(0,1,0,0)</div><div class="separator" style="clear: both; text-align: left;">(0,0,1,0)</div><div class="separator" style="clear: both; text-align: left;">(0,0,0,1)</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">In fact, all the lattices in this method are the same shape, but with different irrationals for time, the simplest being: √3, √2, √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">5/3</span>, √6, √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">4/3</span>, √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">3/2</span>, √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">7/5</span>. They are therefore all rectangular lattices, the different time values represent different stages where the lattice returns to its original shape. So, although √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">4/3</span> is a more square lattice it has to boost further than the √3 version in order to regain its shape.</div><div class="separator" style="clear: both; text-align: left;">The problem with this lattice, which is not made clear in the paper is that, while one can boost this lattice in each of the 3 dimensions separately, it doesn't allow any boost to remain in a bounded gap lattice, for example a boost in the x+y+z direction has events located directly on the light cone, so these will stretch and squash without bounds.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Another technique as highlighted on a <a href="https://plus.google.com/117663015413546257905/posts/6MEi2TAvPaS" target="_blank">John Baez post</a>, uses a <a href="http://arxiv.org/abs/1003.0564" target="_blank">compiled list</a> of possible Minkowski lattices, these are encoded as <a href="http://en.wikipedia.org/wiki/Dynkin_diagram" target="_blank">Dynkin diagrams</a>. Of all the rank 4 ones (for our 3+1 space-time) it is interesting that there is only one which is both symmetrisable and compact. I'm not really sure what this means, but compactified Minkowski space is interesting as it adds extra symmetries to the group of Poincare transforms, and is used for example by Roger Penrose in his Road to Reality book. In any case, both conditions sound like they add extra symmetries to this group in one form or another, this Dynkin diagram is labelled sr136 (simply the 136th diagram to be labelled), or H13(4) (the 13th Hyperbolic Dynkin diagram of rank 4).</div><div class="separator" style="clear: both; text-align: left;">Calculating the root vectors is not simple, and I had to assume that we use a Minkowski metric (t<sup>2</sup> is negative) in the angle calculations. One can either find a set of vectors with angles between them defined by the diagram rules and known relative lengths, or equivalently you can find them by generating the Cartan matrix from the diagram and using each element as the dot product between the two vectors divided by the first vector's square magnitude. It gives basis vectors (for diagram elements 1-4) as:</div><div class="separator" style="clear: both; text-align: left;">(0,2,0,0),</div><div class="separator" style="clear: both; text-align: left;">(0,-1,1,0),</div><div class="separator" style="clear: both; text-align: left;">(0,0,-1,1),</div><div class="separator" style="clear: both; text-align: left;">(√7,-1,-1,-3)</div><div class="separator" style="clear: both; text-align: left;">Using linear combinations and Lorentz transforms we can simplify this to:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">(√3,0,0,0),</div><div class="separator" style="clear: both; text-align: left;">(0,1,0,0),</div><div class="separator" style="clear: both; text-align: left;">(0,0,1,0),</div><div class="separator" style="clear: both; text-align: left;">(√<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">1/12</span>, 1/2, 1/2, √<span style="border-top-style: solid; border-top-width: 1px; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px; padding: 0px 0.1em; white-space: nowrap;">1/2+1/12</span>)</div><br />which is very similar to the other method, but apparently has the symmetrisable and compactness properties which would be interesting to investigate. In both cases the sum of the square vector lengths is 0.TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-86642755566418711332014-09-27T02:29:00.001-07:002014-09-27T02:29:53.535-07:00Black ringsAssuming black holes exist, it is true that every one of them must spin, since the chance of one forming with exactly 0 angular velocity is 0. Black holes are thought to create a singularity in their centre, which is hidden behind their Schwartzchild radius, or event horizon. It seems to me (without thinking too hard about the maths) that a spinning black hole should produce an infinitely dense ring rather than a single point. A ring spinning around its axis should hold itself open.<br /><br />What is interesting about this is that a singularity in the form of a ring is an allowable kind of analytic function of 3d space with two or more layers of volumes. By this I mean that you could pass through the ring and into a different version of 3d space without I think violating general relativity. This is a bit like ideas about space-time wormholes but it is different, it doesn't connect two distance areas of space by a shortcut, it is just a particular geometry of space where everywhere is continuous (apart from the ring singularity) but the world through the ring is different from the world if you pass by the ring without going through it. Moreover, there are potentially an unbounded number of layers each time you circle around the ring and through it.<br /><br />Would make a nice concept for a sci-fi movie.<br /><br />I wonder if such a physical setup could be simulated... the ring doesn't have to be massive, it could be the size of a door, so long as the ring is infinitely dense (which doesn't mean massive).TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-28518706933862357112014-09-12T04:30:00.001-07:002014-09-15T03:51:02.811-07:00Reaction Diffusion FractalsPrevious work with <a href="http://tglad.blogspot.com.au/2012/03/implementing-fractal-automata.html" target="_blank">fractal automata</a> has the disadvantage that it lacks continuous rotational symmetry (it also lacks continuous translational and scale symmetry). An interesting idea is to instead work with <a href="http://www.karlsims.com/rd.html" target="_blank">reaction-diffusion</a> systems which are already continuous in rotation and translation symmetry, and try to add scale symmetry. The normal formula is as follows (and is explained in the link above):<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-HfXTkHQ9t0U/VBLPjiBVX5I/AAAAAAAAAfY/Wst3IRSEhas/s1600/gray-scott-formula.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-HfXTkHQ9t0U/VBLPjiBVX5I/AAAAAAAAAfY/Wst3IRSEhas/s1600/gray-scott-formula.jpg" height="112" width="320" /></a></div>Scaling Du and Dv scales the size of the patterns formed, it seems that the pattern size is proportional to the square root of this scale. Therefore we choose to scale by t<sup>2</sup> where t is our scaling factor.<br /><br />Next we change all of our variables to be vectors rather than scalars. This represents a list of independent reaction diffusion systems. We then choose vector <u>t</u> to be (1,t,t<sup>2</sup>,....), in other words the difference between each reaction diffusion system is a geometric increase in scale. If we view the first three components of v in the red,green and blue channels respectively, then the result is simply a superimposed set of three reaction diffusion systems (using Du = 1, Dv = 0.5):<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-7auHMi7XZ0s/VBLRRgGwXcI/AAAAAAAAAfk/eU2yexzzcuI/s1600/react1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-7auHMi7XZ0s/VBLRRgGwXcI/AAAAAAAAAfk/eU2yexzzcuI/s1600/react1.png" height="187" width="200" /></a></div><div class="separator" style="clear: both; text-align: left;">Here the red scale is the smallest, the green is noticeably twice the scale, and blue twice again.</div><div class="separator" style="clear: both; text-align: left;">The final ingredient is to have these separate scales interact with eachother, we do that in the reaction part of the formula, which is the uv<sup>2</sup>...</div><div class="separator" style="clear: both; text-align: left;">each u is reacting with two vs, we replace the v vector (v for each scale) with a weighted average of all the vs where the weighting is an exponential dropoff s<sup>|x|</sup> around each component. Effectively the vector v has been convolved with an exponential dropoff function, or low pass filtered. This gives us an extra parameter s, when s=0 we have no interaction like the image above, s=1 gives equal interaction which prevents any separation of the different components. Values in between are interesting.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Here we choose a small value of s = 0.05. t = 0.5 so we double the scale of each component (red,green,blue). I plot the reaction diffusion system with varying parameters F and k on the horizontal and vertical axes respectively (increasing right and up). </div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-oXbGraYCcqI/VBLUrnmWzJI/AAAAAAAAAf0/EfEIAek0e3A/s1600/react2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-oXbGraYCcqI/VBLUrnmWzJI/AAAAAAAAAf0/EfEIAek0e3A/s1600/react2.png" height="197" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">zoomed out</div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-AU9-VfC4HwE/VBLUrY122tI/AAAAAAAAAfw/wZ4kUqpJEsE/s1600/react4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-AU9-VfC4HwE/VBLUrY122tI/AAAAAAAAAfw/wZ4kUqpJEsE/s1600/react4.png" height="196" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">s=0.05. zoomed in slightly. Varying the parameters in x,y shows the different patterns possible.</div><div class="separator" style="clear: both; text-align: left;">Next are with s = 0.1. The three components are more correlated. Notice that the thin bridges are more red (small scale) and the large areas more blue. </div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-EKaqxM6MXRM/VBLUs3pstBI/AAAAAAAAAgI/iAVwPGfiICY/s1600/react5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-EKaqxM6MXRM/VBLUs3pstBI/AAAAAAAAAgI/iAVwPGfiICY/s1600/react5.png" height="198" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">zoom around 0.027, 0.058, range 0.08</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-xWQGKcLBvV8/VBLUtCNiUbI/AAAAAAAAAgM/TOl-DyiTvhs/s1600/react6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-xWQGKcLBvV8/VBLUtCNiUbI/AAAAAAAAAgM/TOl-DyiTvhs/s1600/react6.png" height="200" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">zoom around 0.026, 0.057, range 0.04</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-fnbSrbfaJko/VBLUt_fEiuI/AAAAAAAAAgU/jjFvSA527HY/s1600/react7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-fnbSrbfaJko/VBLUt_fEiuI/AAAAAAAAAgU/jjFvSA527HY/s1600/react7.png" height="200" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">zoom around 0.023, 0.055, range 0.02</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-OxkBCNLBZWM/VBLUufmcmfI/AAAAAAAAAgc/grEXT1fg1bc/s1600/react8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-OxkBCNLBZWM/VBLUufmcmfI/AAAAAAAAAgc/grEXT1fg1bc/s1600/react8.png" height="199" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">zoom around 0.023, 0.051, range 0. (unvarying in x,y)</div><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-YjFSQFzkau4/VBLUu9bmglI/AAAAAAAAAgk/jJNZSrd-Kbo/s1600/react9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-YjFSQFzkau4/VBLUu9bmglI/AAAAAAAAAgk/jJNZSrd-Kbo/s1600/react9.png" height="199" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;">similar area, unvarying parameters. Notice the similar worm shapes at each scale.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">The system does not require the scales are doubled for each component, here we show a zoomed out image for t=0.7, so green is roughly 1.4 times the width of red. </div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-sXb__Es7mWY/VBLUroNG_4I/AAAAAAAAAf4/idBebwj2qb4/s1600/react10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-sXb__Es7mWY/VBLUroNG_4I/AAAAAAAAAf4/idBebwj2qb4/s1600/react10.png" height="200" width="199" /></a></div><div class="separator" style="clear: both; text-align: left;">In fact the results are an approximation of a continuous scale symmetry as t<span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 13.8888883590698px; line-height: 15.5555543899536px;">→</span>1 from below. Make sure to change the dropoff to s<sup>|x|log<sub>2</sub>(1/t)</sup></div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com2tag:blogger.com,1999:blog-8438916308834541294.post-84679120323472301052014-07-18T05:51:00.002-07:002014-07-24T02:42:18.845-07:00Symmetric binary fractalsIn a previous post I discussed <a href="http://tglad.blogspot.com.au/2012/03/implementing-fractal-automata.html" target="_blank">fractal automata</a>, which are like cellular automata (e.g. Conway's game of life) but include larger and smaller <i>scales</i> as neighbours as well as nearby <i>locations</i>. This is summarised here: <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/automataFinder">https://sites.google.com/site/tomloweprojects/scale-symmetry/automataFinder</a><br /><br />A subset of these systems are static fractals, generated by applying binary rules to lower resolution maps.<br />It is useful to try and find a setup with as much symmetry as possible and with as few degrees of freedom as possible. The default system operates on a 2d grid and so exhibits square symmetry. The 'type 7' fractals displayed in the above link use a semi-cheat to allow for octagonal symmetry. It works very well but has some drawbacks; it cannot be animated and isn't really octagonal in its symmetry, just close. It also doesn't extend to 3d which up to now has just cubic symmetry.<br /><br />A new idea, which is the topic of this post, is to use extra dimensions to provide extra symmetry. If I use a 3d grid, and apply binary rules to convert low resolution voxels progressively to higher resolution ones, doubling the resolution each step, then take a long-diagonal cross section (the plane defined by x+y+z = 0) then the resulting 2d image has hexagonal symmetry. If I make the low resolution data just a 2x2x2 block of set voxels then the rules result in images such as these:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-Gz39kKK5msw/U8kHEAvHGUI/AAAAAAAAAcM/172MAAMI0ug/s1600/snow1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-Gz39kKK5msw/U8kHEAvHGUI/AAAAAAAAAcM/172MAAMI0ug/s1600/snow1.png" height="200" width="198" /></a></div> <a href="http://4.bp.blogspot.com/-oBeGqlbnH38/U8kHFxpoIvI/AAAAAAAAAcc/-dk3zWEne9Y/s1600/snow3.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-oBeGqlbnH38/U8kHFxpoIvI/AAAAAAAAAcc/-dk3zWEne9Y/s1600/snow3.png" height="177" width="200" /></a><br /><br /><br /><a href="http://4.bp.blogspot.com/--biIF6SLa8I/U8kHHuIsymI/AAAAAAAAAck/c0NlNOhnRyM/s1600/snow4.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/--biIF6SLa8I/U8kHHuIsymI/AAAAAAAAAck/c0NlNOhnRyM/s1600/snow4.png" height="191" width="200" /></a><a href="http://3.bp.blogspot.com/-LyED_TRiQ5o/U8kHJB1v6uI/AAAAAAAAAcw/oAztGw5OoYY/s1600/snow5.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-LyED_TRiQ5o/U8kHJB1v6uI/AAAAAAAAAcw/oAztGw5OoYY/s1600/snow5.png" height="198" width="200" /></a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-LvRUaOVKchQ/U8kHI81CBZI/AAAAAAAAAcs/f5PZpQmjs68/s1600/snow6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-LvRUaOVKchQ/U8kHI81CBZI/AAAAAAAAAcs/f5PZpQmjs68/s1600/snow6.png" height="183" width="200" /></a></div> <a href="http://2.bp.blogspot.com/-4N5g7MkkxCw/U8kHL7mE4QI/AAAAAAAAAdA/4q5pN8s7uys/s1600/snow8.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-4N5g7MkkxCw/U8kHL7mE4QI/AAAAAAAAAdA/4q5pN8s7uys/s1600/snow8.png" height="189" width="200" /></a><br /><br /><div class="separator" style="clear: both; text-align: left;">Of course, one can easily make a grid with hexagonal symmetry (a triangular lattice), but the problem is that we need to elegantly register each cell to its lower resolution cell on a coarser version of the grid. For triangular lattices the obvious choice is for 4 triangles to refer to one parent triangle, however these triangles have different geometric locations relative to their parent, it can be the centre triangle or one of the three corner triangles, consequently you need different rules for each case and the rule set becomes larger which defeats the goal of minimising degrees of freedom (the number of possible rules).</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">By contrast, for 3d voxels, each of 8 child voxels occupy an identical corner of the parent 2x2x2 scaled voxel in my implementation. The ruleset I chose for the above images is therefore quite succinct... I base it only on the seven closest parent voxels, which, assuming cubic symmetry, gives 40 possible configurations of these seven voxels. The ruleset provides an on/off of the child voxel for each of these combinations, therefore 2^40 possible rulesets.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">I can reduce this large search space down further by enforcing bit symmetry, this specifies that on and off are arbitrary so if a particular low res shape produces a particular high res fractal, then the negative (on and off swapped) low res shape produces a negative of the fractal. This reduces the search space down to 2^20 rulesets.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">A last improvement is to acknowledge that a ruleset and its negative are functionally no different if you have bit symmetry, so we can normalise by choosing the version which converts all seven parent voxels being off to an off state for the child. Resulting in 2^19 rulesets.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">You can of course also view the 3d shape generated, but in 3d you miss the details behind the surface:</div><div class="separator" style="clear: both; text-align: left;"><a href="http://4.bp.blogspot.com/-HpyeC6mwsVU/U8kOSYvPvGI/AAAAAAAAAdY/20teDRuMTr0/s1600/snow11.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-HpyeC6mwsVU/U8kOSYvPvGI/AAAAAAAAAdY/20teDRuMTr0/s1600/snow11.png" height="188" width="200" /></a><a href="http://3.bp.blogspot.com/-IjB8c7irttc/U8kORxg2wuI/AAAAAAAAAdU/2LvE6YBSsf4/s1600/snow3d11.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-IjB8c7irttc/U8kORxg2wuI/AAAAAAAAAdU/2LvE6YBSsf4/s1600/snow3d11.png" height="200" width="200" /></a></div><br /><h4 style="clear: both; text-align: left;">Optimisation</h4><div>For the 2d images, we only need a single plane of high resolution voxels, and these trace back to a thin slice through the coarser resolution voxels. Therefore the processing required is much less than for viewing the 3d output and is almost definitely O(n^2) for resolution nxn unlike O(n^3) for the 3d case. This also means that the initial seeds are only needed in a thin slice of the 3d voxel grid.</div><h4 style="clear: both; text-align: left;">Random seeds</h4><div>I can also seed randomly, which gives a better overview of how each ruleset looks on arbitrary input:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-pZ2k6AuqTOc/U8kUlx_w2eI/AAAAAAAAAds/ODjCw14OEOM/s1600/rand1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-pZ2k6AuqTOc/U8kUlx_w2eI/AAAAAAAAAds/ODjCw14OEOM/s1600/rand1.png" height="200" width="188" /></a></div> <a href="http://3.bp.blogspot.com/-MlL9Kjdq0Ss/U8kUl2MK8lI/AAAAAAAAAdw/-Cx4X-F-RZg/s1600/rand2.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-MlL9Kjdq0Ss/U8kUl2MK8lI/AAAAAAAAAdw/-Cx4X-F-RZg/s1600/rand2.png" height="200" width="195" /></a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-ue3n-sR1pC0/U8kUm0qXZyI/AAAAAAAAAd8/c2BRPxEKHLA/s1600/rand4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-ue3n-sR1pC0/U8kUm0qXZyI/AAAAAAAAAd8/c2BRPxEKHLA/s1600/rand4.png" height="200" width="198" /></a></div> <a href="http://1.bp.blogspot.com/-B33UiTgtdJk/U8kUpoAvj-I/AAAAAAAAAeQ/LwiJN4hptb0/s1600/rand5.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-B33UiTgtdJk/U8kUpoAvj-I/AAAAAAAAAeQ/LwiJN4hptb0/s1600/rand5.png" height="183" width="200" /></a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-l3hLk9VTAiU/U8kUoPvx9XI/AAAAAAAAAeE/5xX3RE6VeIg/s1600/rand6.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-l3hLk9VTAiU/U8kUoPvx9XI/AAAAAAAAAeE/5xX3RE6VeIg/s1600/rand6.png" height="200" width="200" /></a></div> <a href="http://4.bp.blogspot.com/-H4innv3EUjE/U8kUpf6VaDI/AAAAAAAAAeM/TDW5k6_S_vA/s1600/rand7.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-H4innv3EUjE/U8kUpf6VaDI/AAAAAAAAAeM/TDW5k6_S_vA/s1600/rand7.png" height="182" width="200" /></a><br /><br /><br /><h4>Extensions</h4><div>There are clearly variations on the rulesets that I'm using, one could look at a larger neighbourhood, or remove bit symmetry etc, I could also change the scaling factor (if the parent to child scaling is 3 rather than 2 then I am sure one can reconstruct the Koch snowflake for instance), but more degrees of freedom almost always gives less symmetric and less interesting (more noisy) results.</div><div><br /></div><div>However, this method has several advantages, it <i>probably</i> can be made to animate (fractal automata), and it can be extended to higher dimensions.</div><div>3d fractals could be generated which have what is probably octahedral symmetry rather than cubic symmetry, by using a 3d long-diagonal cross section of a 4d binary fractal. </div><div>I am also wondering whether one can make use of the highly symmetric <a href="http://en.wikipedia.org/wiki/16-cell_honeycomb" target="_blank">D4 lattice</a> in 4d to create even more symmetric 3d fractals... however I'm not sure how elegantly you can register one 24-cell to a parent larger 24-cell.</div><div><br /><h4>Simpler</h4></div><div>I'll finish with some examples from a simpler system where I just look at the 4 closest parents. In this case I haven't used bit symmetry. You can sort of see there is more simplicity in the rules. The last image uses a random seed.</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-_EyLhrXmzM8/U8nlYqcF5xI/AAAAAAAAAek/M-Rdz-GJC08/s1600/type2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-_EyLhrXmzM8/U8nlYqcF5xI/AAAAAAAAAek/M-Rdz-GJC08/s1600/type2.png" height="200" width="183" /></a></div> <a href="http://3.bp.blogspot.com/-ZS5wS22zG8g/U8nlZNtL7CI/AAAAAAAAAeo/fDBzmSQyh4U/s1600/type2b.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-ZS5wS22zG8g/U8nlZNtL7CI/AAAAAAAAAeo/fDBzmSQyh4U/s1600/type2b.png" height="200" width="191" /></a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-1-APQeAFKDQ/U8nlZERpzPI/AAAAAAAAAew/AXTJoImX49A/s1600/type2c.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-1-APQeAFKDQ/U8nlZERpzPI/AAAAAAAAAew/AXTJoImX49A/s1600/type2c.png" height="194" width="200" /></a></div> <a href="http://4.bp.blogspot.com/-5wv6LsLEFYQ/U8nlb0Ox07I/AAAAAAAAAe8/nEbt4hYcFhY/s1600/type2d.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-5wv6LsLEFYQ/U8nlb0Ox07I/AAAAAAAAAe8/nEbt4hYcFhY/s1600/type2d.png" height="200" width="198" /></a><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-stvvmpC65XU/U8nlcJ1uhvI/AAAAAAAAAfA/0HFcdP9ebkc/s1600/type2rand.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-stvvmpC65XU/U8nlcJ1uhvI/AAAAAAAAAfA/0HFcdP9ebkc/s1600/type2rand.png" height="181" width="200" /></a></div><div><br /></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-69138496253658560992014-06-06T19:37:00.001-07:002014-07-26T15:41:39.540-07:00Mary Morris DiariesThis is quite unlike my previous posts but I wanted to keep a record of the events of the publication of my Grandma's diaries.<br />It is a fascinating story of a rebellious young Irish nurse who is thrown into the deep end as the war starts, having to care for gravely ill children with hopelessly inadequate supplies and in the midst of bombing raids (her sister hospital takes a direct strike). She follows the soldiers into France with the Normandy landings where she tends a field hospital on the frontline. Her patients are axis and allies alike and, in the face of daily tragedy and disease, she finds her strength in her patients with their varied and charming personalities. As a nurse and perhaps being Irish (who were neutral) she brings a culturally un-sided and stark account of the major events of WWII, dispairing at the poor treatment of German prisoners in British run PoW camps, and relaying British foot soldiers' dismay at not getting the air backup they were promised. Through the chaos she meets a man who is to become her husband as the war is ending, she tells of his role to protect the German civilians from Russian soldiers who are conducting revenge attacks.<br /><br /><br />Links:<br />Wikipedia: <a href="https://en.wikipedia.org/wiki/Mary_Morris_(Diarist)">https://en.wikipedia.org/wiki/Mary_Morris_(Diarist)</a><br />Family blog: <a href="http://marymorrisauthor.blogspot.co.uk/2014/06/her-wartime-diaries.html">http://marymorrisauthor.blogspot.co.uk/2014/06/her-wartime-diaries.html</a><br />Old BBC entry by Grandpa:<span style="background-color: white; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20px;"> </span><a href="http://www.bbc.co.uk/history/ww2peopleswar/stories/53/a4106053.shtml" rel="nofollow nofollow" style="background-color: #fcfcff; color: #176093; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20px; text-decoration: none;" target="_blank">http://www.bbc.co.uk/history/ww2peopleswar/stories/53/a4106053.shtml</a><br />Irish times: <a href="http://www.irishtimes.com/culture/heritage/an-irishman-s-diary-on-an-irish-nurse-in-wartime-1.1817784" style="background-color: white; color: #1155cc; font-family: arial, sans-serif; font-size: 12.727272033691406px;" target="_blank">http://www.irishtimes.com/<wbr></wbr>culture/heritage/an-irishman-<wbr></wbr>s-diary-on-an-irish-nurse-in-<wbr></wbr>wartime-1.1817784</a><br />Daily Express: <a href="http://www.express.co.uk/news/uk/481145/The-forbidden-diary-of-a-wartime-nurse">http://www.express.co.uk/news/uk/481145/The-forbidden-diary-of-a-wartime-nurse</a><br />Irish mail on Sunday, June 1st, 2014<br />Irish times book review: <a href="http://www.irishtimes.com/culture/books/discovering-an-irish-nurse-s-unique-wwii-diary-1.1829873?page=3">http://www.irishtimes.com/culture/books/discovering-an-irish-nurse-s-unique-wwii-diary-1.1829873?page=3</a><br />Connacht tribune: <a href="http://connachttribune.ie/caltra-nurses-d-day-diary-bestseller/">http://connachttribune.ie/caltra-nurses-d-day-diary-bestseller/</a><br />Daily mail: <a href="http://www.dailymail.co.uk/home/books/article-2680044/Nightingale-Dunkirk.html">http://www.dailymail.co.uk/home/books/article-2680044/Nightingale-Dunkirk.html</a><br />Essay by Carol Acton: <a href="http://dx.doi.org/10.1080/09670880903533417">http://dx.doi.org/10.1080/09670880903533417</a><br />Irish times book review: <a href="http://www.irishtimes.com/culture/books/irish-nurse-s-account-of-the-war-a-very-private-diary-1.1874768">http://www.irishtimes.com/culture/books/irish-nurse-s-account-of-the-war-a-very-private-diary-1.1874768</a><br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-48207263586797045232014-03-11T04:03:00.002-07:002014-03-11T04:03:40.872-07:00Operator before additionI'm sure this idea is not new but, well it's a new idea to me. The question is, what comes before the plus operator on numbers? i.e. if we have + then * then power, then tetration... what do we get when going in the other direction?<br />These can be defined by the three valued Ackermann function phi(m,n, x) so phi(m,n, 0) = m+n, phi(m,n, 1) = m*n etc. The question may then be what is phi(m, n, -1)?<br />I'm going to call this operator # (or 'with').<br />I say 'may' because the extension of these numerical operators is perhaps ambiguous and so it may be that there are different correct answers depending on your interpretation of the existing operators. In a <a href="http://tglad.blogspot.com.au/2010/07/that-crazy-formula.html" target="_blank">previous post</a> I thought that # is the equality operator, it returns m if m==n, otherwise it returns void.<br /><br />Today's idea is to make:<br /> m # n = log_2(2^m + 2^n)<br />So we get a sequence<br />a#a = a+1<br />a+a = a*2<br />a*a = a^2<br /><br />The identity value for all four:<br />a#-inf = a<br />a+0 = a<br />a*1 = a<br />a^1 = a.<br /><br />The operators are different because they consider the arguments in a different context... for addition the values m and n are considered as points along a line, for multiplication they are considered to be magnitudes, and for the # operator they are considered to be entropies. This is important because entropy is a very fundamental concept so having # as an operator as fundamental as + and * is useful in learning to deal with entropy and information.<br />For example, the information needed to store either a 16 bit colour or a 16 bit alpha is 16#16 = 17bits. Anyway, # is a sum 'as though the arguments are entropies'. It also has an inverse:<br />m -# n which is just log_2(2^m - 2^n).<br /><br /><br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-75848155304272333342013-12-14T02:36:00.001-08:002013-12-14T03:06:08.548-08:00Rolling fractals: Thistles and leaves<div class="separator" style="clear: both; text-align: left;">An interesting fractal construction comes from rolling circles inside a stack of larger circles. This has been considered <a href="http://blog.matthen.com/post/15481855128/if-you-roll-a-circle-inside-one-3-times-its-size">here</a> and <a href="http://benice-equation.blogspot.com.au/2012/01/fractal-spirograph.html">here</a>... however I don't think these designs are the correct maths for proper conformal rolling circles. The equation I uses gives a different result.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">For a set of nested circles of power 2 diameters, rolling with a constant roll contact point speed, in alternating directions I get this:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-rQBFOAAHMSU/Uqw6u5R_JlI/AAAAAAAAAWs/CSjkPW24tAs/s1600/rollfrac.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-rQBFOAAHMSU/Uqw6u5R_JlI/AAAAAAAAAWs/CSjkPW24tAs/s1600/rollfrac.png" height="319" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;">It is part of a set of fractals which are defined by the curvature ratio from parent to child. Here we see the family for ratios -4,-3,-2, 2, 3, 4. (-1,0 and 1 are not fractals).</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-q7iPnrbgC94/UqwyiNUDvCI/AAAAAAAAAWc/s1ljXAQg8rM/s1600/roll-fracs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-q7iPnrbgC94/UqwyiNUDvCI/AAAAAAAAAWc/s1ljXAQg8rM/s640/roll-fracs.png" height="134" width="640" /></a></div>None of these fractals appear to self intersect.<br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-5924775890985396192013-10-01T21:41:00.004-07:002013-11-24T00:47:03.567-08:00The golden egg<i>The value 0 is the set that is a distance 0 from its negative.</i><br /><i>The unit diameter circle is the set that is a distance 1 from its negative.</i><br /><i><br /></i><i>The value 1 is the set that is a distance 0 from its inverse.</i><br /><i>What is the set that is a distance 1 from its inverse?</i><br /><br />One point in the set is the golden ratio (1.618..) since its inverse is 0.618... but it isn't the only point in the set, for instance 0.618 is also in the set. Also cos(30) + 0.5i is in the set since its inverse is cos(30) - 0.5i. The full set is drawn in blue:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-NGNzDbNN1Rk/UpG83s1xfoI/AAAAAAAAAV8/rJCjZj15PVQ/s1600/goldenegg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="http://2.bp.blogspot.com/-NGNzDbNN1Rk/UpG83s1xfoI/AAAAAAAAAV8/rJCjZj15PVQ/s320/goldenegg.png" width="320" /></a></div>The green curve is an ellipse, since the blue oval is 'fatter' at smaller real values and thinner at larger real values it is in egg shape; I'll call it the golden egg! In fact there are two of these, one being the negative of the other.<br /><br />The left and right sides can be calculated iteratively and separately, for the left side (lesser real values):<br />a = 1/(c + a) where c is the unit radius circle.<br />For the right side:<br />a = 1/a - c<br /><br />Does anyone know the analytic formula?<br /><br /><br />One could extend this idea to the quaternions (a golden orb? volume embedded in 4d) and presumably also to the octonions.TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-16241772642495097202013-02-13T03:37:00.000-08:002013-02-17T01:54:59.124-08:00Relativistic automata continued IIIn a <a href="http://tglad.blogspot.com.au/2012/07/relativistic-automata-continued.html">previous blog</a> I outlined roughly how you can add velocity symmetry neatly into fractal automata (from now on called Lorentz automata). Here are some implementation descriptions.<br /><br /><h3>Minkowski lattice</h3>The data structure for cellular automata is the (n dimensional) grid, for fractal automata it is a grid-tree, otherwise known as a quad-tree and oct-tree in two and three dimensions respectively. For Lorentz automata I use what I call a Minkowski lattice (or M lattice). Similar to a grid tree, but each grid has several children of different elongations, as such two parents can have the same child, which makes this structure a lattice:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-HLr7aEuZnag/UReOnz3SCKI/AAAAAAAAAQE/9Z0dgzsupnY/s1600/velocitySymmetry2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-HLr7aEuZnag/UReOnz3SCKI/AAAAAAAAAQE/9Z0dgzsupnY/s320/velocitySymmetry2.png" width="278" /></a></div><br /><div>The data structure is therefore the set of grids with resolutions (2^w, 2^h) for all w,h between 1 and the highest resolution depth. The non-square grids represent non-zero velocity frames.<br /><br /><h3>Lattice update order</h3>Assuming we have such grids available for accessing and setting the bit value at any point on the grid, the challenge is then to find the correct order at which each cell of each grid is updated. For the 1+1 Minkowski space-time the update order can be seen as follows:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-Z2jmWeh2NkY/URiqtBQpbVI/AAAAAAAAAQU/RUx0kHiDSSs/s1600/tem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://3.bp.blogspot.com/-Z2jmWeh2NkY/URiqtBQpbVI/AAAAAAAAAQU/RUx0kHiDSSs/s640/tem.png" width="640" /></a></div>The image shows the high resolution grid on the left and two lower resolution grids as examples. The red/green arrows indicate the local coordinate origin for each grid. If a single frame step is defined as one quarter the diagonal length of the highest resolution grid then the centre of the grid cells and all lower resolution grid cells always pass through one of these frame times (shown as blue line).<br />We want each cell to be updated when the frame time hits the centre of that cell, so the simplest algorithm is to iterate through all the grids and update all the cells that touch the line.<br /><br />In 2+1 space-time the frame-time represents a plane which the 3d grid cell centres sit on. The direction of time is along the long-diagonal of the grid coordinates. To update the cells correctly you need to define a resolution for the plane, e.g. 256x256, then for each grid it must find cell centres that lie on and in this clipped plane:<br /><br /><span style="font-family: Courier New, Courier, monospace;">for (i = 1; i<=resolution; i*=2)<br /> for (j = 1; j<=resolution; j*=2)<br /> for (k = 1; k<=resolution; k*=2)<br /> for (x = centre.x-resolution; x++)</span><br /><span style="font-family: Courier New, Courier, monospace;"><centre .x="" br="" nbsp="" resolution="" x=""> if ((x&(2*i-1)) != i) <br /> continue;<br /> for (y = centre.y-resolution; y++)</centre></span><br /><span style="font-family: Courier New, Courier, monospace;"><centre .x="" br="" nbsp="" resolution="" x=""><centre .y="" br="" resolution="" y=""> if ((y&(2*j-1)) != j)<br /> continue;<br /> z = frame - x - y;<br /> if ((z&(2*k-1)) != k)<br /> continue;<br /> updateCell(x/(2*i), y/(2*j), k/(2*k)); </centre></centre></span></div><div><br /></div><div>Interestingly the update of the lattice has an exactly constant number of updateCell calls per frame, which is useful for real-time use. The number of updateCell calls approaches 4 times the number of pixels, so the cost of adding velocity symmetry using these Lorentz transforms is finite and small, unlike with Galilean transforms.<br /><br /></div><div><h3>Cell update </h3><div>With the fractal cellular automata the half-resolution parent cell is located at (frame - 1)>>1. For these Lorentz automata it is simply this for each axis, e.g. (x-1)>>1 on each axis that is half-resolution. This therefore applies to elongated grids too. The purpose of this is that you only retrieve data from neighbour cells that are prior in time.</div><div><br /></div><div>Conversely, the double-resolution children cells are located at x << 1 and ( x << 1 ) - 1 again ensuring that these neighbours are prior in time so have already been set.<br /><br /><h3>Results</h3><!--1--></div><div>Due to the large search space, I start with a hand-built automata rule:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-RY4NGNThQ5Y/UReHC3H9zhI/AAAAAAAAAP0/vXwMNgYPyj0/s1600/velocitySymmetry.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="293" src="http://2.bp.blogspot.com/-RY4NGNThQ5Y/UReHC3H9zhI/AAAAAAAAAP0/vXwMNgYPyj0/s320/velocitySymmetry.png" width="320" /></a></div><div>This diagram shows a very simple Lorentz automaton, there are just four points with zero velocity, each with scale twice the previous. The larger scale points (set in the larger voxel grid) are interpreted by the successively higher resolution grids such that the resulting shape is a high resolution hexagon in this case. A different rule could generate any shape like those seen in the static fractal automata.</div><div>Additionally there are seven clones of these 4 points which have successively larger upwards velocities (velocity 1), and also 7 clones with successively larger diagonal velocities (velocity 2 in the diagram).</div><div>The picture was taken after a few seconds, so the points have moved from their initial positions. You can see most clearly the tiny points in the bottom right area, notice that the points are not evenly spaced along the velocity, even though they each have the same difference in speed. This is because we are using a relativistic velocity. The points get closer together towards the top, this is the equivalent of approaching the speed of light.</div><div>Looking at the top left section of large hexagons, it looks a bit like a grid of points, this is because there are points for each non-uniform power of two scale, which give the different point directions, velocities and scales. The middle points seem flattened in the direction of movement, this is mainly because the three prime motion directions are elongated in this model and the three secondary motion directions are flattened. But additionally there is some flattening due to time dilation.</div><div>Notice that the decimation (from low res to high res) keeps smoothly shaped hexagons even when they are distorted by their velocity.<br /><br /><h3>Base tiling</h3></div></div><div>While most cellular automata use a square grid, these automata are a bit different. The long-diagonal projection of each cube through time gives a variable shape, but we can make the grid constant by viewing the last three frames rather than just the last frame. This gives us a base hexagonal tiling, which is nice since it has 6 rotational symmetries compared with 4 for a square, plus it is a 'stable' tiling in that it is the most efficient filling of the space. This also extends into 3d (where time is the long diagonal of a 4d 'hyper'cube)... the base tiling becomes a <a href="http://en.wikipedia.org/wiki/Rhombic_dodecahedron">rhombic dodecahedron</a>, with 12 rotational symmetries compared to 6 for the cube. Equally, the honeycomb of rhombic dodecahedrons are the most space efficient way to tile 3d space. </div><div>This also makes the 'diagonal time axis' method an attractive method for normal fractal automata, not just for Lorentz automata.</div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-32367999269888156362012-12-14T16:46:00.000-08:002016-02-28T18:44:49.916-08:00dimension-aware rasterisingHow do you raster geometry? i.e. convert shapes to screen pixels. It might seem like that is a question solved many decades ago but maybe not...<br /><br />Lets take a simple example of a disk (a filled in circle) which is just black against a white background. To render it we just need to set each pixel to black which is inside the circle right?<br />Well that is kind of true but not very accurate since we get jagged looking edges. The most accurate rendering would set the blackness of each pixel to the percentage of that pixel which is inside the disk. This gives a slight gradient along the edge which is smoother, it is sometimes called anti-aliasing:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-hNeKnkm2vwk/UMu4Kv76C9I/AAAAAAAAANg/uS_ZMJ3NoqI/s1600/download.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://2.bp.blogspot.com/-hNeKnkm2vwk/UMu4Kv76C9I/AAAAAAAAANg/uS_ZMJ3NoqI/s1600/download.jpg" /></a></div><div class="separator" style="clear: both; text-align: left;">You can see that the left disk looks better than the right disk, it is in fact the best rendering for this piece of geometry. The blackness is proportional to the area of the pixel that is inside the set.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">This is in fact how most 2d geometry is rendered, for more complicated shapes it is usually achieved by supersampling, which means testing multiple points inside each pixel (e.g. a 4x4 grid of points) and averaging. This is an approximation of the ideal render since it is an approximation of the area under the pixel that is in the set. It gets closer to perfect as you increase the number of supersamples.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">And that's where most rasterisers leave the issue of rastering. But there's a problem, how do you raster a line? You can't calculate the area under a pixel that contains the line because lines don't have area. You could solve the problem by saying that such 'thin' lines are invisible and so you render lines only by giving them a certain width. However this requires choosing a width and it is altering the object to a different shape. We should be entitled to see lines and points and other mathematical objects on our screen, even if they have no area.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">In fact you can raster a line on screen, the ideal raster darkens each pixel in proportion to the<i> length</i> of line under that pixel, rather than the <i>area, </i>as seen in the lower line here:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-76_bHL03rA4/UMu90oFtIXI/AAAAAAAAANw/nnKtS49BPRY/s1600/download+(1).jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-76_bHL03rA4/UMu90oFtIXI/AAAAAAAAANw/nnKtS49BPRY/s1600/download+(1).jpg" /></a></div><div class="separator" style="clear: both; text-align: left;"><i><br /></i></div>Fine, but what about points? Points neither have area or length. The ideal rasteriser would darken each pixel based on the <i>number</i> of points under the pixel.<br /><br />And what about rough objects like the <a href="http://www.jimloy.com/fractals/koch.htm">Koch curve</a>, this has neither length nor area but somewhere in between, in fact it is a 1.26 dimensional object, but that value depends upon its bend angle.<br /><br />So rasterising geometry is starting to look very complicated..<br /><h3>Solution</h3><div>In fact there is a single solution to all these cases, if you know the dimension of the geometry then you measure the 'amount' of geometry under each pixel in units of that dimension. So for the disk you measure the amount under the pixel in pixelWidth^2, for the line you measure the amount in pixelWidth^1, for the point the amount in pixelWidth^0 and for the Koch curve the amount in pixelWidth^1.26 etc. You then darken each pixel in proportion to this 'amount' (The Hausdorff measure). A single method for any dimensional object.</div><div><br /></div><div>For more general shapes where the dimension isn't necessarily known or uniform we can approximate this ideal rasteriser by using supersampling. For each pixel you count the number of sub-pixels in the set at your maximum resolution (e.g. 4x4 for each pixel) <i>c</i> then you also count the number of sub-pixels containing the set at half that resolution (e.g. 2x2) <i>h</i>. The dimension is then calculated as <i>d =</i> log(<i>c</i>/<i>h</i>)/log(2) and the amount by which you darken the pixel is <i>c/r^d</i> where <i>r</i> is the supersample resolution, e.g. 4 in this example.</div><div><br /></div><div>Here is the method applied to the Mandelbrot set. Even though the border has dimension 2, the set itself has various geometry of different dimensions within different scale ranges. e.g. there are crooked lines which might have dimension about 1.2 like the Koch curve, and solid areas with dimension 2:</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-4VYRYszxyLs/UMvE10jYylI/AAAAAAAAAOA/tSfIqfG0TDw/s1600/supersample2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://4.bp.blogspot.com/-4VYRYszxyLs/UMvE10jYylI/AAAAAAAAAOA/tSfIqfG0TDw/s1600/supersample2.png" /></a></div><div><br /></div><div>The left image blackens each pixel if any of the 16x16 supersample points are in the set. It has no anti-aliasing and no smoothness even though the curves at the base should be smooth (since I'm only doing 20 Mandelbrot iterations).</div><div>The right image is averaging the 16x16 supersample points, it gives smooth curves at the base which is correct, but the line areas at the top fade out and you can't even see the geometry at the very top.</div><div>The centre image is using the new method. The base curves are smooth and the line areas at the top are all clearly visible as well as being anti-aliased.</div><div><br /></div><div>I am using a fractal above as an easy way to get complex geometry, but the technique can work on any black and white image. Possibly it could be extended to colour images too, as a way to retain the important information in an image when sampling to a lower resolution. </div><div><br /></div><div>Here's a close up of the above image so you can see the antialiasing:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-oEpPXNLpATw/UMvIEXjgWsI/AAAAAAAAAOQ/Vul2iZa2_5o/s1600/supersample2big.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://1.bp.blogspot.com/-oEpPXNLpATw/UMvIEXjgWsI/AAAAAAAAAOQ/Vul2iZa2_5o/s1600/supersample2big.png" /></a></div><div><br />Here I shade the pixels based on the dimension at that point, viewing part of the Mandelbrot set at 20 and 2000 iterations. You can see the dimension reduces (gets lighter) further up the branch.<br /><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-4ufiOpEjY28/UNGOjljnmwI/AAAAAAAAAPA/0vV-7Z5ogLA/s1600/dimension20vs2000iters.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="159" src="https://2.bp.blogspot.com/-4ufiOpEjY28/UNGOjljnmwI/AAAAAAAAAPA/0vV-7Z5ogLA/s320/dimension20vs2000iters.png" width="320" /></a></div><br />This image shows how you could use dimension-aware rasterising to get useful detail out of downsampled images, in this case showing power lines:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-jeqGL1T7JEw/UN1GCQ7x6WI/AAAAAAAAAPc/X0TrWMlTFmM/s1600/nice.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="356" src="https://2.bp.blogspot.com/-jeqGL1T7JEw/UN1GCQ7x6WI/AAAAAAAAAPc/X0TrWMlTFmM/s640/nice.png" width="640" /></a></div><br /></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-70587907973831143222012-11-28T04:39:00.000-08:002016-11-03T20:05:33.283-07:00Volcanic surface fractalThis is a short post about a new type of fractal surface.<br />Simple fractal surfaces are currently rare, which makes finding an example surface for a particular roughness (or fractal dimension) infeasible.<br />Looking at the simpler case of 2d curves we can quite easily pick a curve for a particular roughness by using a <a href="http://en.wikipedia.org/wiki/L%C3%A9vy_C_curve">Levy</a>, <a href="http://en.wikipedia.org/wiki/Koch_snowflake">Koch curve</a> or <a href="http://en.wikipedia.org/wiki/Dragon_curve">dragon curve</a> with a chosen bend angle. It would be nice to have an equivalent for a surface.<br /><br />Here it is, we replace each triangle with 6 smaller triangles of the same shape, with 4 of these forming a diamond based pyramid. Using the pyramid as the base, we parametise the bend angle by choosing the height of the pyramid for unit length base edges. Here are the first three iterations:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-XGlu2gZRW5U/ULcfI2P4EwI/AAAAAAAAAMs/OWGp1UbQFzI/s1600/iterations.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="97" src="https://3.bp.blogspot.com/-XGlu2gZRW5U/ULcfI2P4EwI/AAAAAAAAAMs/OWGp1UbQFzI/s400/iterations.png" width="400" /></a></div>If you have a good graphics card and running Chrome then you can see it changing in real-time here:<br /><a href="http://glslsandbox.com/e#4851.17">http://glslsandbox.com/e#4851.17</a><br /><br />For pyramid base edge length 1, height <i>h</i> and diamond acute angle <i>a</i> the pyramid and therefore the triangle shape can be fully defined by the equations:<br /><br /> <i>a</i> = atan(((1+2cos(<i>a</i>)+cos(<i>a</i>)<sup>2</sup>)/<i>d</i>)<sup>0.5</sup>) + atan(((1-2cos(<i>a</i>)+cos(<i>a</i>)<sup>2</sup>)/<i>d</i>)<sup>0.5</sup>)<br /> <i>d</i> = 4<i>h</i><sup>2</sup> + sin(<i>a</i>)<sup>2</sup><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-LizyprvPr-A/ULYDG0h0_rI/AAAAAAAAAMc/HpTQDgFCw8U/s1600/surface.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="115" src="https://2.bp.blogspot.com/-LizyprvPr-A/ULYDG0h0_rI/AAAAAAAAAMc/HpTQDgFCw8U/s640/surface.png" width="640" /></a></div><br /><br /><br /><br /><br /><br /><br /><br />This shows the fractal with heights from -0.25 up to 1.0.<br />From 0 up to around 1.75 the Hausdorff dimension increases from 2 up to infinity. The reason the dimension can exceed 3 is that overlapping surfaces 'overfill' the space; mathematically speak, the set is no longer embedded in 3D space.<br />In fact, as the height increases the fractal 'explodes' out exponentially in size. So it reminds me of a volcano, going from a crater to billowing smoke that covers everything!<br /><br />When the height is around 0.55 (4th pic from left) the surface is the roughest it can be without intersecting. This has dimension roughly 2.32. The height of 0.5520923 is interesting for another reason, the triangles are all isosceles at this point (angles 1.1697(*2) and 0.8021). It is tempting to think that this might be the same critical point, but not sure.<br /><br />The Hausdorff dimension D is the solution to the equation:<br />4A^D + (A/d)^D + (A/c)^D = 1<br />where A = cd/(d+c) and<br />c = sqrt(cos^2(a/2) + h^2)<br />d = sqrt(sin^2(a/2) + h^2)<br /><br />The model file for the 0.55 surface is available as .obj and .aoi <a href="https://docs.google.com/open?id=0B8S7Si-yu3DoM2VPWTJIc1BuV2s">here</a> and <a href="https://docs.google.com/open?id=0B8S7Si-yu3DoOURIMXV6WWJKSXM">here</a>. The surface also discussed briefly <a href="https://sites.google.com/site/tomloweprojects/scale-symmetry/measuring-things-with-fractals" target="_blank">here</a> and in this <a href="https://www.researchgate.net/publication/309391846_Three_Variable_Dimension_Surfaces" target="_blank">article</a>.<br /><br />Here's a 2D version, it looks like this for increasing angles 22.5 degrees, 45 degrees, 180*0.29:<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-cERz19OW7a0/WBhjvx1rjLI/AAAAAAAAA3g/4jzms9eRyhUGubY9Fv35eTqrtCXTY6mDwCLcB/s1600/tree180pt125.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="64" src="https://4.bp.blogspot.com/-cERz19OW7a0/WBhjvx1rjLI/AAAAAAAAA3g/4jzms9eRyhUGubY9Fv35eTqrtCXTY6mDwCLcB/s320/tree180pt125.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-yF1XMKzjVe4/WBhj1Lf8YOI/AAAAAAAAA3k/EeRZR43kTYQz3WsKnXunljqkEoBSQDMaACLcB/s1600/tree180pt25.png" imageanchor="1" style="clear: right; display: inline !important; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="125" src="https://4.bp.blogspot.com/-yF1XMKzjVe4/WBhj1Lf8YOI/AAAAAAAAA3k/EeRZR43kTYQz3WsKnXunljqkEoBSQDMaACLcB/s320/tree180pt25.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://4.bp.blogspot.com/-zDbauj7paJM/WBhj5EFo7MI/AAAAAAAAA3o/hyUpxHS7FFUsJQeVznU5nXroaP0lHDzsgCLcB/s1600/tree180pt29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="152" src="https://4.bp.blogspot.com/-zDbauj7paJM/WBhj5EFo7MI/AAAAAAAAA3o/hyUpxHS7FFUsJQeVznU5nXroaP0lHDzsgCLcB/s320/tree180pt29.png" width="320" /></a></div><div><br /></div><h4>Variation:</h4><div>If you reverse the normals of the sub-triangles in the iteration then you have an effect similar to how the Koch curve differs from the Levy C curve. So you end up with a surface which looks the same whichever side you look at it from:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-LFmselDmYgk/ULlM9zN316I/AAAAAAAAAM8/oMT941lbgJA/s1600/funny11.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="125" src="https://1.bp.blogspot.com/-LFmselDmYgk/ULlM9zN316I/AAAAAAAAAM8/oMT941lbgJA/s200/funny11.png" width="200" /></a></div><a href="http://4.bp.blogspot.com/-QulPiZutT78/ULlM_gdbOBI/AAAAAAAAANE/ou_DtFmwizg/s1600/funny12.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="100" src="https://4.bp.blogspot.com/-QulPiZutT78/ULlM_gdbOBI/AAAAAAAAANE/ou_DtFmwizg/s200/funny12.png" width="200" /></a><a href="http://4.bp.blogspot.com/-XirFbCKjfMA/ULlNBkjb05I/AAAAAAAAANM/Ekto6iydPu4/s1600/nice1.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="125" src="https://4.bp.blogspot.com/-XirFbCKjfMA/ULlNBkjb05I/AAAAAAAAANM/Ekto6iydPu4/s200/nice1.png" width="200" /></a><br /><br />In this case the largest height before self intersection is about 0.35, as in the picture.<br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">Unlike in the 3d case, the 2d equivalent can go to a larger bend angle before intersecting when its non-V line segment is flipped, here at 45 degrees and the maximum at 60 degrees:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://2.bp.blogspot.com/-vOpI75_4oKs/WBhkfxOu6dI/AAAAAAAAA3w/l322fsi5ceE8eilCOKtp2oGZan7C_BcxgCLcB/s1600/treeReverseypt125.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://2.bp.blogspot.com/-vOpI75_4oKs/WBhkfxOu6dI/AAAAAAAAA3w/l322fsi5ceE8eilCOKtp2oGZan7C_BcxgCLcB/s320/treeReverseypt125.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-1YHx5wxjRYo/WBhkj907PGI/AAAAAAAAA34/b9o_iAm8Oo4E_1Sa2s-eDCB_fmA7QwdWgCLcB/s1600/treeReversey60deg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="https://1.bp.blogspot.com/-1YHx5wxjRYo/WBhkj907PGI/AAAAAAAAA34/b9o_iAm8Oo4E_1Sa2s-eDCB_fmA7QwdWgCLcB/s320/treeReversey60deg.png" width="320" /></a></div><div class="separator" style="clear: both;">This curve is surprisingly symmetric in its design, and like the Koch curve, you can make a snowflake out of it. </div><div><br /></div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-52886530750168794962012-10-05T01:58:00.002-07:002012-10-05T01:58:59.498-07:00Mandelbrot physics ideaThis is a skeleton of an idea about a possible way to generalise the Mandelbrot set into one that obeys Einstein's field equations and so would represent a 'universe' with gravity and time.<br /><br />The Mandelbrot set is the constraint Z = Z^2 + C, this can be thought of as its 'law of physics' and it is invariant to any conformal transformation. This is similar to the theory of relativity which defines the laws of physics as invariant to any 4x4 transformation, this is called <a href="http://en.wikipedia.org/wiki/General_covariance">general covariance</a>. The reason we want general covariance is that it means the laws of physics aren't dependent on any coordinate frame and therefore they are in some sense universal laws. For the same reason the Mandelbrot set is <a href="http://www.math.harvard.edu/~ctm/papers/home/text/papers/muniv/muniv.pdf">said to be universal</a>, and this is why it appears an infinite number of times in certain other fractals. By the way, it isn't necessary that our laws of physics be universal, but it is massively more likely that we find ourself under universal laws than not.<br /><br />Equally it is massively more likely that our universe is on the limit set (the invariant set) of its laws than not. All fractals, like the Mandelbrot set are limit sets.<br /><br />I wonder, if we replaced the Mandelbrot set with M = M*M + C where M and C are 4x4 matrices, then would we have a rule which is invariant to <i>any </i>4x4 transform? My guess is that we would.<br />This set of 4x4 matrices could be thought of as the set of energy-stress tensors in Einstein's field equations, or equally the set of tensors representing the curvature of space (since this is proportional to the energy-stress tensor).<br /><br />Notice that these curvature tensors don't have an associated position in space-time. This is actually what we want because the space-time in general relativity can me many different topologies and we shouldn't expect it to fit inside a single coordinate system.<br /><br />So we interpret our set of curvatures to be correct and must build our space-time such that it contains only these curvatures. The constraints on how the curvatures should be distributed in space is defined by Einstein's relativity. In particular, there should be no torsion in the space-time, and the space-time should be such that the curvature tensors satisfy the special type of Ricci curvature as defined in Einstein's field equations.<br /><br />I don't understand exactly how to implement this, but the basic idea is to start at a random curvature tensor in the set and build up the space-time geometry in the neighbourhood based on the subset of neighbouring tensors that you want to use to satisfy the field equations. Each curvature tensor in the set has 16 axes of neighbours, whereas we only need 4 axes of neighbours to generate space-time, so possibly this will help in building the space-time. Additionally, the set should already obey general covariance.<br />The idea is that you therefore only calculate and see the space-time geometry in your vicinity, no need for a global coordinate system and we naturally get a space-time which is specific to the observer.<br /><br />You may be thinking that this particular universe will appear to be almost full with matter since every point will have a curvature of some sort. I don't think this is necessarily true, the algorithm to generate a compliant space-time is free to generate as much space and time as it likes, so it could well generate large areas of space between nearby curvature tensors, in order to satisfy the field equations.<br />Additionally, each curvature tensor can appear many times in many different spots of the generated space-time, since the 16 dimensional set allows the relatively thin 4d space-time to overlap and pass through itself from many different angles.<br /><br /><h4>Summary</h4><div>So, IF we could write an algorithm to generate compliant space-time to satisfy the set of curvature tensors, then our simple 4x4 Mandelbrot set may be a very interesting 'Einstein universe' to study. Not least because, like the Mandelbrot set, it literally comes from nothing; you start from a zero matrix and simply apply the rule to itself.</div><div>This idea also is perhaps a slightly different way of looking at the universe. Space-time is simply the result of interpreting a set of curvatures under a few constraints, it isn't fundamental but an interpretation.</div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-42088220375160508852012-09-11T01:48:00.003-07:002012-09-11T14:54:50.630-07:00Current understanding of physicsI thought I'd share my current interpretation of how I think relativity and quantum theory work, from a high level. Maybe I'll get time to study them more in future, but here are my current thoughts.<br /><h3>Special relativity</h3><div>Time is simply an imaginary spatial dimension, so its square value is negative. This is a sufficient premise for describing <a href="http://en.wikipedia.org/wiki/Minkowski_space">Minkowski space</a>, time dilation, constant speed of light etc. The rest of the theory is just making mass/electro-magnetic equations etc consistent with this single premise.</div><div>Why don't we have galilean (old fashioned) relativity? perhaps because a finite communication speed is more general than a single infinite one, or maybe unbounded communication speed leads to circular dependencies, so cannot be consistent.</div><h3>General relativity</h3><div>Think of space-time as a 4d space populated with some 4d vectors (with units of momentum). The distribution of these vectors requires a matrix to define them for each little volume of space-time. Much as a <a href="http://en.wikipedia.org/wiki/Stress_(mechanics)">stress tensor</a> defines the stress on an object, this 4x4 matrix defines how dense the vectors are in each direction. If you think of the volume of space-time as a tesseract (4d cube) then the matrix defines the total vector amplitude for a given axis against each cubic side of the tesseract.</div><div>This density matrix defines the curve of space-time at that particular point. The curve is the second differential in space of the volume of the space. This curve is represented by a matrix, called the <a href="http://en.wikipedia.org/wiki/Ricci_tensor">Ricci tensor</a>, Einstein removes a proportion of the trace of this matrix in order to prevent any torsion of space. I believe this is a principle of least work. </div><div>So, if we know our distribution of 4d vectors, we calculate the curvature matrix at each point and we have a space where the second differential is known. An iterative method could take these curvatures on a flat Minkowski space and converge to the warped space-time, which is defined by a matrix at each point (<a href="http://en.wikipedia.org/wiki/Metric_tensor">metric tensor</a>). This matrix is 4x4 and looks like a -1,1,1,1 identity in Minkowski space. Bent space-time will deviate from this. </div><div>I think of this as like the 4d vector equivalent of a thermal distribution, where most of the space wants to simply be the mid temperature between its neighbours. That is a scalar example, for a 4d vector you need to work with matrices as this does.</div><div>So what are these momentum vectors? they generalise force and mass, if they point in the time direction they are like mass, which moves objects due to gravity, if they point in a spatial direction they are like a pressure and they move objects like a force. Since the curvature matrix is just proportional to the <a href="http://en.wikipedia.org/wiki/Energy%E2%80%93momentum_tensor">density matrix</a>, a time-pointing vector (a mass) will cause a bend in time, and a space pointing vector (a force) will cause a bend in space. Though it is more of a mixture than this, due to subtracting the trace from the Ricci matrix, I think.</div><div><br /></div><div>Now that we have a metric for the whole of our space-time, we need to iterate to move the mass distribution, it should shift to only be along the geodesics (locally straight lines in the bent space-time). I'm not so clear how this is best done.</div><div>Of course this moves the mass distribution so you have to re-iterate the whole thing continually until it converges to a valid Einstein universe.</div><h3>Quantum theory</h3><div>I personally don't see anything weird about quantum theory. It is a set of differential equations (much like most physics theories), the main difference being that it operates on complex numbers rather than the reals. This small difference means that values don't just accumulate, they can also annihilate. The path-integral formulation shows the wave-particle duality in action, a single interaction on a particle is integrated over all space-time and all possible interactions to produce a field (the wave aspect). This is really no different than classical physics formulas using calculus, since differential equations are defining the rules at a single point and requiring they be integrated over space-time to form a field. So no real difference there (apart from the use of complex numbers).</div><div>The remaining aspect that people say is different is that the integrated values only define a probability of an effect, rather than an amplitude. This is not actually the case in my opinion. When a simple object like a photon hits a macroscopic object like a recording device, the complex waves decohere and average out to effects that are more classical (amplitudes), the resulting state of the universe contains a spectrum of versions of the same scientist that see the detector light up at different points. Hence it is only natural that any single observer thinks the results are random after repeating the experiment many times. In other words the many-worlds theory seems most sensible and (apart from state-space not occupying a single time-line) the physics of quantum theory is just another set of equations like all the others.</div><h3>Combining</h3><div>Since complex numbers are complete, it seems to me that general relativity will need to include complex numbers to work together with quantum theory. This was tried to some degree of success in <a href="http://en.wikipedia.org/wiki/Twistor_theory">Twistor Theory</a>, but this theory uses twistors which can't handle arbitrary 4x4 deformations, so can't really get beyond special relativity.<br />It is true that a 1,-1,-1,-1 metric space is just as valid for general relativity as a -1,1,1,1. This is a rotation by 90 degrees of having i,1,1,1 as the components of time and space. It should follow that any rotation is equally valid, so we have a free parameter in general relativity where quantum objects can be stored... perhaps.</div><h3>Extending</h3><div>One problem with these theories is they assume the existence of real numbers, and/or continuums. An improvement would be to define each point in terms of larger and smaller points, so that a continuum emerges in the integration. This is different than normal calculus, but similar to covolution mentioned in a <a href="http://tglad.blogspot.com.au/2012/02/extending-convolution.html">previous post</a>. It also allows certain rules to _not_ produce a continuum but rough (as in fractal) distributions.</div>TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-54623253566447528292012-08-03T18:06:00.004-07:002012-08-20T00:56:53.229-07:00alternative relativistic automataThe most general expression of my <a href="http://www.blogger.com/blogger.g?blogID=8438916308834541294#editor/target=post;postID=5164481568248745634">previous post on relativistic automata</a> can be summarised as follows.<br />Use any automata rule which updates a cell based on its nearest neighbours, but subject it to this condition:<br /><br /><i> For any rule acting on a small volume of space, represented by a 4x5 matrix which defines a position and 4-parellelotope (4d parallelogram) volume, then the same rule must apply to every possible 4x5 matrix and act on the equivalently transformed cell.</i><br /><i><br /></i>The resulting automata has no specific reference frame so is relativistic by design. The direction of the line of time will vary depending on the frame of the observer, and the arrow of time is based on which side has the higher entropy. A simpler way to say this is:<br /><br /><i> If the automata turns image A into image B then it would also turn the image of a transformed (sheared, scaled, rotated) image A into an equally transformed image B.</i><br /><br />This idea can be partially achieved with regular grid automata as discussed in that post. However regular automata may not allow arbitrary rotations and scale, possible just 90 degree rotations and scale by powers of two.<br /><br />So a different form of automata may be better in this role.<br /><h3>stochastic automata:</h3><br />1. place an arbitrary number of 'cells' down randomly anywhere in a 4d space, and set each to either on or off.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-vKYELZCTvaU/UBTWHsebfRI/AAAAAAAAAK0/7P7P2T8k7J0/s1600/stoch1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-vKYELZCTvaU/UBTWHsebfRI/AAAAAAAAAK0/7P7P2T8k7J0/s1600/stoch1.png" /></a></div><br />2. for each cell, pick <i>n</i> other cells at random to be its neighbours or inputs.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-7ecGTWurSCY/UBTWLpdK-_I/AAAAAAAAAK8/C5w-mg1Fi9c/s1600/stoch2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-7ecGTWurSCY/UBTWLpdK-_I/AAAAAAAAAK8/C5w-mg1Fi9c/s1600/stoch2.png" /></a></div><br />3. pick an arbitrary rule to choose the cell's bit based on its inputs. We can then trial many rules and see what behaviours are common.<br />4. the automata will then evolve simply by iterating all the cells repeatedly.<br /><br />Interestingly this basic scheme is all the functionality that is required, the remainder comes down to reinterpreting this data in a way that fits with how we interpret the real world... Here is a first design, lets call it..<br /><br /><b><br /></b><b>Eigenvector Scheme:</b><br /><br />In this design the rule is a function of the number of input bits, not the individual bits, so is like Conway's life in that sense:<br /><br /><b> </b>a. place each cell in 20 dimensional space, of which 4 dimensions are the usual space-time.<br /> b. move each cell to the centre of its inputs, in 20d space<br /> c. the new position of the cell requires re-scaling, stretching and shearing the distribution of inputs so that the 20d cell position is an accurate covariance matrix of its inputs.<br /> d. repeat for all cells and iterate until convergence.<br /><br /><br />The expectation is that the cells will order themselves into a network where each cell's neighbours represent nearby points in 20d space. i.e. volumes attach to volumes rather than points attaching to points in normal automata.<br />We can then decide on some simple rule, such as cell bit = >50% of inputs set. And we can consider the behaviour as reaching some sort of ideal as the number of cells increases and the number of inputs per cell increases to infinity.<br /><br />The main difficulty with this might be finding the least-work transform to change the inputs into the required covariance distribution. We might want to say that a covariance is only defined by its eigenvectors and values, but that means different points in 20d space have identical meaning. A solution might be to constrain cells to lie only on the eigenvector/value manifold of 20d space.<br /><br /><b>Reconnect Scheme:</b><br />Instead of moving points around in 20d space, we could alternatively try re-connecting the graph into one that satisfies the rule at the top of this post.<br /><br /> a. place each cell in a 20 dimensional space, representing the 4x5 skew shape for the cell connections.<br /> b. for each cell, find the closest neighbours in the 16 'covariance' dimensions, 2 for each dimension.<br /> c. move the cell to the centre of these neighbours.<br /> d. for each cell, find the closest along-axis inputs for its required matrix shape, 2 for each dimension, so the eight unique inputs closest to where they should be.<br /> e. move the cell to the centre of this shape and move the inputs to exactly match that required.<br /><br />The rule then acts on 40 individual inputs per cell, allowing more rules than the above scheme.<br />Unlike the previous scheme, this one doesn't have ambiguity with several covariances having the same meaning because we are dealing directly with a grid-like scheme. The problem is that reconnecting inputs creates a non-smooth iteration which could jump around and potentially never converge.<br /><br /><b>Grid-annealing Scheme:</b><br /><br /> a. at equidistant points in 16 dimensional space, place and connect points in a grid which is shaped by the covariance matrix at that 16d point. This results in a 20d set of cells with 8 inputs each.<br /> b. for each cell, find the 32 unique nearest neighbours in 20d and make then inputs<br /> c. the 40 inputs all have a preferred 4d position, iterate shifting the cell positions to descend towards an approximation.<br /><br />This scheme is simple to implement and will definitely converge. But it may not be ideal as the grid-like connections probably don't make it optimal.<br />It seems sensible that not only should the 4d spacing be affected by the covariance, but also the 16d spacing. So that matrix variations are closer together on small grids. But this gets harder to picture when we consider the stretched and rotated spacing for a general 4x4 matrix.<br /><br /><h3>Convolution automata:</h3>Although the idea of relativistic automata is simply stated (top of post), it is hard to find an algorithm that will implement it. Grid-based methods seem too constrained, you can't rotate by a random angle and get the same results for example. Stochastic methods may get around this by breaking the rigid grid symmetry, but there is no clear best approach as yet.<br />More-over, the idea of expanding the Minkowski symmetries (rotation, boost, translation, scale) to full 4x5 transforms is speculative. It relies on certain of those matrices naturally being somehow not seen by the user.<br /><br />A different approach is to expand convolution, so move from bit fields to real numbers.<br />Convolutions usually convolve over space, but here we make them convolve over volume too:<br /><br />1. take a 4d grid of real values, and a convolution kernel, for example a 3x3x3x3 grid of real coefficients.<br />2. convolve the grid (i.e. apply the filter to every position on the grid), this could be considered as a convolve for a kernel scale matrix of diagonal (1,1,1,1).<br />3. repeat the convolve for a different scale matrix of (0,0,0,2), this is equivalent to scaling the kernel by two in the 4th dimension. Add this new convolve on top of the previous.<br />4. repeat again for diagonal matrix (0,0,0,3) and again up to (0,0,0,n)<br />5. in fact repeat this for every integer 4x4 matrix (not just diagonal matrices), each one equates to a transform of the original kernel.<br /><br />And there we have it, a matrix-independent automata.<br />One problem is that the size of the result will grow as the convolution range increases. So it might need a reducing scale factor with size... so that it appears the same at all possible scales and transforms. You could weight each convolution based on the 4-volume of the transform, or perhaps more efficiently, you could use non-integer transforms, varying the gap between each transform based on its volume, such that the total effect at each volume is probably proportional to the 4th root of that volume.<br />An unanswered question is whether higher resolution (small gaps between transforms) converges to a solution or whether it somehow averages out to just give a blurry mess.<br /><br /><h3>Relativistic Folding Fractals</h3><div>Although this may not class as an automata, a simpler scheme to generate 4d shapes with some transform symmetry is to extend the idea of <a href="http://www.fractalforums.com/ifs-iterated-function-systems/kaleidoscopic-(escape-time-ifs)/">Kaleidoscopic Iterated Function Systems</a>. It works like so:</div><div><br /></div><div> 1. for each point in 4d space-time, apply some transform to the point, composed of:</div><div> a. rotations</div><div> b. translations</div><div> c. scale (enlargement)</div><div> d. <a href="http://en.wikipedia.org/wiki/Lorentz_transformation">boosts</a></div><div> e. folds</div><div> 2. repeat up to n times (larger n is more accurate)</div><div> 3. draw the points that stay within a certain 4d Minkowski distance, which is defined as sqrt(x^2 + y^2 + z^2 - t^2)</div><div><br /></div><div>The folds can be a reflection in just the x axis or the t axis. The boosts, translations and rotations allow the equivalent of any possible fold. Equivalently you could define fold operations about any 4d axis and 4d point.</div><div><br />Here I have a simple implementation: <a href="http://tglad.powweb.com/relativisticFractals.html">http://tglad.powweb.com/relativisticFractals.html</a><br /><br /></div><div>This is the bare minimum relativistic version, we could also try expanding the fractal to include any 4x5 transform (plus folds), this fractal makes it easy to try out different combinations.</div><div><br /></div><br /><br /><br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-51644815682487456342012-07-26T04:52:00.000-07:002012-12-27T23:22:19.726-08:00Relativistic automata continuedPreviously I covered some ideas about fractal automata and extending it to a kind of relativistic version. I'll summarise this then describe some thoughts on extending the system to be more relativistic.<br /><h4> translation</h4>Starting with simple cellular automata, like <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">conway's game of life</a>, we generalise it by saying that the function acting on each cell (which chooses whether to turn the cell on or off) can be any function of n nearest neighbours. Typically we pick some small set, like the 9 neighbours in a 2d grid (including the centre one). Giving 2^n possible neighbour patterns and 2^2^n possible functions. The choice of function isn't too important here, what is interesting is the type of results you get by searching through the set of functions as applied to initially random data.<br /><h4 style="text-align: left;"> scale</h4>We can expand this system to <a href="http://www.blogger.com/blogger.g?blogID=8438916308834541294#editor/target=post;postID=7014813595067311364">fractal cellular automata</a> by using a grid tree rather than a single grid, the nearest neighbours for each cell include those on the parent and child grids as shown here:<br /><a href="http://4.bp.blogspot.com/-8Blz6I8q0QY/UA0nS0Gm5LI/AAAAAAAAAKI/p3h1tF16lsY/s1600/layers2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-8Blz6I8q0QY/UA0nS0Gm5LI/AAAAAAAAAKI/p3h1tF16lsY/s1600/layers2.png" /></a><br />The coloured cells being example nearest neighbours of the red cell. Typically you watch the highest detail grid evolve. This system effectively gives you a continuous euclidean space, which is more physically real than a discrete grid.<br /><h4> non-uniform scale</h4>These grids can be 3d too, or even 4d. But to deal with time properly we need to use a Minkowski 4d space rather than a euclidean grid. It can be approximated by making the time axis the long diagonal of the 4d grid and allowing non-uniform scales, i.e. cuboid grids. So just as scale becomes like an extra degree of freedom in fractal automata, we let scale in x, y and z separately become three extra degrees of freedom. As discussed in my <a href="http://www.blogger.com/blogger.g?blogID=8438916308834541294#editor/target=post;postID=5305541980030124453">previous post</a>. The non-uniform scale allows the same rules to apply at different velocities, which are represented by the different non-uniform scales.<br /><a href="http://3.bp.blogspot.com/-mUPNQ9s4gvE/UBEADzE2q7I/AAAAAAAAAKY/jcPR0oGj-Do/s1600/relative.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://3.bp.blogspot.com/-mUPNQ9s4gvE/UBEADzE2q7I/AAAAAAAAAKY/jcPR0oGj-Do/s1600/relative.png" /></a><br />At this point there are actually two ways that you can work with time here, you can make the cellular automata only depend on cells that are further back in time, which means that the automata spreads forwards along the time direction:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-pn-MKriujiA/UBEBF8vNZHI/AAAAAAAAAKg/6YrCLzI5cqY/s1600/evolve.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-pn-MKriujiA/UBEBF8vNZHI/AAAAAAAAAKg/6YrCLzI5cqY/s1600/evolve.png" /></a></div>Or you can keep the cells dependent on all the neighbours (both forwards and backwards in the time direction). This means that a whole span of time evolves as you iterate the automata. This second method has three possible outcomes:<br />1. The evolving automata converges on a fixed result. This can then be 'played' as a single time line.<br />2. The automata ends up in a cycle, so no single time line exists, but you could consider each result as being parallel time lines.<br />3. The automata doesn't settle into a cycle (so is a strange attractor). This has some similarities with the many-universe interpretation of quantum theory, since there are infinite time lines, describable by a probability density function. So any of the time lines is a valid result, after it has converged.<br /><h4> symmetric sheer</h4>The next step is to allow a diagonal stretch of the grid. This corresponds to information which changes more or less slowly with time:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-ZnHoSewCU9s/UBEDl-uhdHI/AAAAAAAAAKo/aduramz1VMg/s1600/massScale.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-ZnHoSewCU9s/UBEDl-uhdHI/AAAAAAAAAKo/aduramz1VMg/s1600/massScale.png" /></a></div>This feature is part of general relativity, time is more dense close to high mass objects. This change in the 'speed of the physics' is what causes objects to fall under gravity. It hasn't been tested, but the idea is that moving points will deflect into the higher density areas, causing something vaguely like gravitation.<br />This extension has some problems which require a further addition to solve; the stretched grids have a different apparent maximum velocity, inconsistent with the real world.<br /><br />I have headed the sections in this post to show the different symmetric transforms that each algorithm adds to the system. Continuing this theme and generalising, a square cell can be transformed by any transformation matrix. So there are a few remaining degrees of freedom that can be added as extra symmetries:<br /><h4> rotation</h4><div>If the path of massive objects is allowed to rotate with time (as opposed to a boost, which is the non-uniform scale above) then the object will be able to attain just as high speed as a light object, which is physically real. However it doesn't appear to obey special relativity since the rotation could make any object go faster than some maximum (light) speed. </div><div>I think the way this is avoided is that the frame that we visualise is the square (not uniformly scaled) frame, and the frame of heavier objects is 'ghosted' onto this square frame, just as low resolution objects 'ghost' onto the high resolution mesh that we view. The ghosting process prevents the object going faster than light since it can't ghost beyond this speed.</div><div>This is again a bit speculative, but it seems that the movement of a high mass (stretched) grid can only change direction over a longer period of time, in other words its acceleration should be less in general, and would be symmetric to higher acceleration in a lower mass object.</div><h4> non-symmetric sheer</h4><div>The final degrees of freedom are non-symmetric sheering of the cell. This relates to symmetric sheer much as pressure relates to mass or energy in general relativity I think. So for a 4d space-time, the general transform would be a 4x5 matrix, giving 20 dimensions to the cellular automata.</div><h4> dealing with scale problems</h4><div>The problem with using symmetric scale for mass is that the stretch only jumps by some fixed factor, like two.</div><div>Similarly, the problem with using rotation with time to give a mass a velocity is that grid-based cellular automata can only rotate by 90 degrees. </div><div>The solution to such problems might be to treat the scales (which are the rows of the 4x4 matrix) the same way as position is treated (the 5th row), i.e. use the overall scale to allow each row to be continuous. </div><div>I'm not sure how well this idea works, so this problem leads to a completely different formulation that I will discuss in the next post.</div><h3> Summary</h3><div>Space-time is usually thought of as a 4d continuum of points, something which could be naively modelled as a 4d grid cellular automata. </div><div>Instead, if we think of space-time as built of 4d volumes then the description of such volumes which is independent of any reference frame is one which is symmetric to any 4x5 transform. This is quite similar to the principles of special and general relativity. Such a 20 dimensional automata could potentially have the following extra realisms over basic cellular automata:</div><div><br /></div><div>1. It is continuous</div><div>2. parts can have velocity</div><div>3. nothing goes faster than light, time dilation etc of special relativity<br />4. many-world timelines, consistent with some quantum effects</div><div>5. mass affecting how fast something accelerates<br />6. gravitational wells (general relativity)</div><div>7. attraction based on pressure (also part of general relativity)</div><br /><br /><br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-22384625080586425032012-06-19T05:55:00.000-07:002012-12-27T23:24:50.482-08:00Quaternions aren't rotationsRecently I discussed the difference between unit intervals and integers. Unit intervals are kind of the complement or the opposite of integers, they represent the whole space between each integer, and you could say that they represent the full transition between each consecutive integer.<br /><br />This is relevant because I was recently reading about the spin group Spin(n) and the special orthogonal group SO(n). The special orthogonal group can be thought of as an n dimensional rotation matrix and the spin groups are spinors which kind of represent rotations as well, but have the confusing feature that you need to travel 720 degrees to return to the same spot. The 3d spinor is the same as the quaternion.<br /><br />Spinors are confusing, as illustrated by Michael Atiya (from the Wikipedia article on spinors):<br />"<i style="font-family: sans-serif; font-size: 13px; line-height: 19px;">No one fully understands spinors. Their algebra is formally understood but their general significance is mysterious. In some sense they describe the “square root” of geometry and, just as understanding the <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Square_root_of_-1" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: none;" title="Square root of -1">square root of -1</a> took centuries, the same might be true of spinors.</i>"<br /><br />It dawned on me that spinors are to the rotation matrices what intervals are to the integers. Spinors are the full set of configurations between two rotation matrices. So they do not represent attitudes (orientations) themselves.<br /><br />Looking at the 3d example, the attitude of an object is its 3x3 rotation matrix. If you attach that object by many elastic strings to a reference frame (like to the walls of the room that it is in) then the 3d spinor (which is a quaternion) represents the configuration of the strings (which do only repeat after a rotation of 720 degrees of the object). <br />So in this example the rotation matrices are the object and the room, and the quaternion is the strings. It is a full path (or interval) between two rotations, which is quite different to a relative rotation matrix.<br /><br />To rotate a vector v by a spinnor s, you do: s' * v * s. Same for rotating a rotation matrix by s.<br />The reason for the double operation (which also explains the double cover) is easier to see if you convert back to the integer and interval analogy:<br /><br /><br />Integers are just points, which really convey no size. In order to add 1 to an integer, first you must append a unit interval from the integer (think of laying down a metre rule from that point), then you must append the point to the other end of the unit interval, so you are doing the first operation kind of in reverse. <br />In fact, for any vector you can move to a different vector position by laying down a straight line (an interval) from the first point, then placing the new vector at the other end of the line.<br />This two-stage symmetric operation can be defined as s' * v * s.<br /><br /><br />So in fact, basic arithmetic and vector operations can actually be done using these two complementary objects (the point and the interval), we just don't usually think of it that way as we have a simpler system of adding only vectors. But this two object system is exactly what is required for operations acting on orientations.<br /><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0tag:blogger.com,1999:blog-8438916308834541294.post-53055419800301244532012-05-13T02:23:00.002-07:002012-05-13T02:23:41.030-07:00Adding some relativity to fractal automataA previous post described fractal automata, which are just like other cellular automata but they also include scale as effectively an extra dimension.<br />Here's how to add the main component of special relativity to these fractal automata.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-ts8e7r8NxNg/T690qlI0wtI/AAAAAAAAAJg/73jSw_oHQxw/s1600/time.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="http://2.bp.blogspot.com/-ts8e7r8NxNg/T690qlI0wtI/AAAAAAAAAJg/73jSw_oHQxw/s320/time.png" width="320" /></a></div>Consider the case with one space dimension and one time dimension. Classically we could uses a 2d grid to discretise in time and space. For special relativity (Minkowski space) we rotate this grid 45 degrees...<br />Now consider the black square in the centre of the diagram above. An equivalent square directly below it would just touch the axis origin so be visible at time zero. This below square has the black square as its neighbour, and so if its update rule turns the square on when its neighbour is on then this piece of space will continue to propagate through time.<br /><br />The diagonal rectangles represent squares that have a velocity. Each one has the same volume and each one's diagonal point the the origin, so they are all objects that will hit distance 0 at time 0. The way to represent these in the cellular automata is to have separate grids for each power of two on each axis. The cellular automata rules can then act on neighbouring velocities as well squares in neighbouring space.<br />If we draw a grid of the possible scales then we can see that, in addition to its <i>spatial</i> neighbours, each pixel has several <i>scale </i>neighbours:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-kBHi1IJg5RE/T695pQSiu_I/AAAAAAAAAJs/9yOW84FQjfc/s1600/scales.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-kBHi1IJg5RE/T695pQSiu_I/AAAAAAAAAJs/9yOW84FQjfc/s1600/scales.png" /></a></div><div class="separator" style="clear: both; text-align: left;">The mapping applied to each rectangle must be the same at every position on this grid.</div><div class="separator" style="clear: both; text-align: left;">The neighbours seen as black arrows are squares that have a velocity, and the neighbours in green are smaller and larger scale versions of the square. In other words, we already use the uniformly scaled neighbours, that is what makes it fractal automata rather than normal cellular automata, we are now just incorporating non-uniform neighbours. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Amazingly this is all that is needed to allow for special relativity's space-time geometry, time dilation etc, and it allows cellular automata to act on objects with a velocity, without any particular privaleged velocity. The rules are velocity independent. Though I can't show an example as I haven't built any yet.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><h2>2D</h2><div>In 2 dimensions things get trickier. We can't just rotate our grid by 45 degrees. There may be other solutions but my solution is to use a 3d grid and have the time axis as the long diagonal. Squares can then be elongated along three different axes, which equates to different diagonal motions of the object when the axes are different, and it equates to different size objects when they are the same. </div><div class="separator" style="clear: both; text-align: left;"><br /></div>It approximates the light cone by a triangular pyramid.<br /><br /><h2>3D</h2><div>This is an extension of the 2d approximation, you use a 4d grid and have time as the long diagonal. The expanding light sphere is approximated by an expanding tetrahedron. </div><br />TGladhttp://www.blogger.com/profile/01082123555974465066noreply@blogger.com0