Hadamard von Koch
- To: mathgroup at smc.vnet.net
- Subject: [mg99142] Hadamard von Koch
- From: Roger Bagula <rlbagula at sbcglobal.net>
- Date: Tue, 28 Apr 2009 04:45:53 -0400 (EDT)
Hadamard von Koch: http://www.geocities.com/rlbagulatftn/hadamard_vonkoch.gif I turned my Hadamard matrix self-similarity type programming to making other fractals this morning. This one gives an von Koch like internal hole. Mathematica: Clear[HadamardMatrix]; MatrixJoinH[A_, B_] := Transpose[Join[Transpose[A], Transpose[B]]]; KroneckerProduct[M_, N_] := Module[{M1, N1, LM, LN, N2}, M1 = M; N1 = N; LM = Length[M1]; LN = Length[N1]; Do[M1[[i, j]] = M1[[i, j]]N1, {i, 1, LM}, {j, 1, LM}]; Do[M1[[i, 1]] = MatrixJoinH[M1[[i, 1]], M1[[i, j]]], {j, 2, LM}, {i, 1, LM}]; N2 = {}; Do[AppendTo[N2, M1[[i, 1]]], {i, 1, LM}]; N2 = Flatten[N2]; Partition[N2, LM*LN, LM*LN]] HadamardMatrix[2] := {{1, 1}, {1, 0}}; HadamardMatrix[3] := {{1, 1, 0}, {1, 0, 1}, {0, 1, 1}} HadamardMatrix[n_] := Module[{m}, m = {{1, 1, 0}, {1, 0, 1}, {0, 1, 1}}; KroneckerProduct[m, HadamardMatrix[n/3]]]; M = HadamardMatrix[27] Table[D[Sum[M[[n]][[m]]*x^(m - 1), {m, 1, n}], {x, 1}], {n, 1, Length[M]}]; Table[CoefficientList[D[Sum[ M[[ n]][[m]]*x^(m - 1), {m, 1, n}], {x, 1}], x], {n, 1, Length[M]}]; Flatten[%] ListDensityPlot[HadamardMatrix[37], Axes -> False, Mesh -> False, AxesLabel -> None, Frame -> False]