Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7536 > unrolled thread

problem calculating a square simplex IFS triangularization

Started byRoger Bagula <roger.bagula@gmail.com>
First post2012-01-02 07:51 +0000
Last post2012-01-03 10:28 +0000
Articles 2 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  problem calculating a square simplex IFS triangularization Roger Bagula <roger.bagula@gmail.com> - 2012-01-02 07:51 +0000
    Re: problem calculating a square simplex IFS triangularization Roger Bagula <roger.bagula@gmail.com> - 2012-01-03 10:28 +0000

#7536 — problem calculating a square simplex IFS triangularization

FromRoger Bagula <roger.bagula@gmail.com>
Date2012-01-02 07:51 +0000
Subjectproblem calculating a square simplex IFS triangularization
Message-ID<jdrnmg$935$1@smc.vnet.net>
A very simple 3 color IFS?
This code is based on a simplex triangularization of a triangle.
Does anybody have simplex triangularizations for other shapes?

Clear[f, dlst, pt, cr, ptlst]
dlst = Table[ Random[Integer, {1, 3}], {n, 50000}];
f[1, {x_, y_}] := {1/2 + x/2 - y/2, 1/2 - x/2 - y/2}
f[2, {x_, y_}] := {y, 0}
f[3, {x_, y_}] := {1/2 - x/2 - y/2, 1/2 - x/2 - y/2}
pt = {0.5, 0.5};
cr[n_] = If[n - 1 == 0, RGBColor[0, 0, 1],
   If[n - 2 == 0, RGBColor[0, 1, 0],
    If[n - 3 == 0, RGBColor[1, 0, 0], RGBColor[0, 0, 0]]]];
ptlst = Table[{cr[dlst[[j]]],
    Point[pt = f[dlst[[j]], Sequence[pt]]]},
      {j, Length[dlst]}];
Show[Graphics[Join[{PointSize[.001]}, ptlst]],
 AspectRatio -> Automatic, PlotRange -> All]

I call this the tic tac toe simplex...
I found a simplex for square the hard way
and am having a hard time calculating it:

Clear[f, dlst, pt, cr, ptlst, a, r, x, y]
dlst = Table[ Random[Integer, {1, 17}], {n, 20000}];
r = 3.2;
a = Flatten[
Table[{1/2 + n*x/r + m*y/r, 1/2 + l*x/r + k*y/r}, {n, -1, 1,
2}, {m, -1, 1, 2}
, {l, -1, 1, 2}, {k, -1, 1, 2}], 3]
Length[a]
Log[Length[a] + 1]/Log[(1 + 16*r)/17]
f[1, {x_, y_}] := {y, 0}
Table[f[n, {x_, y_}] = a[[n - 1]], {n, 2, Length[a] + 1}]
pt = {0.5, 0.5};
cr[n_] :=
Flatten[Table[
If[i == j == k == 1, {}, RGBColor[i, j, k]], {i, 0, 1, 0.5}, {j,
0, 1, 0.5}, {k, 0, 1, 0.5}]][[1 + Mod[n, 26]]];
ptlst = Table[{cr[dlst[[j]]],
Point[pt = f[dlst[[j]], Sequence[pt]]]},
{j, Length[dlst]}];
Show[Graphics[Join[{PointSize[.001]}, ptlst]],
AspectRatio -> Automatic, PlotRange -> All]

The problem is Mathematica hates this code.
I'm trying to find the optimum ratio r such that the square is just
closed.
It might work with fewer transforms as well ( I just threw everything
at it).

[toc] | [next] | [standalone]


#7547

FromRoger Bagula <roger.bagula@gmail.com>
Date2012-01-03 10:28 +0000
Message-ID<jdul7p$jod$1@smc.vnet.net>
In reply to#7536
This set is the triangulation analog of the tic tac toe set in
pentagons done as a level like L system
( by guess and by golly).
Dr. McWorter's pentagree and Penrose's pattern are
probably related.
This result  is a 5th type Simplex self-similar fractal.
I had a hard time just getting an approximation of the third level.
There should be some simple recursive pattern here!
Mathematica:
Clear[v, x, y, g, g1, g2, vv, s, x1, y1]
x[n_] := N[Cos[n*2*Pi/5]];
y[n_] := N[Sin[n*2*Pi/5]];
x1[n_] := N[Cos[n*2*Pi/5 + 2*Pi/5]];
y1[n_] := N[Sin[n*2*Pi/5 + 2*Pi/5]];
x2[n_] := N[Cos[n*2*Pi/5 + Pi/10]];
y2[n_] := N[Sin[n*2*Pi/5 + Pi/10]];
x3[n_] := N[Cos[n*2*Pi/5 + 3*Pi/20 + 0.01]];
y3[n_] := N[Sin[n*2*Pi/5 + 3*Pi/20 + 0.01]];

v = Join[{{0, 0}}, Table[{x[n], y[n]}, {n, 1, 5}]];
v1 = Join[{{0, 0}}, Table[{-x1[n], y1[n]}, {n, 1, 5}]];
s = Sqrt[5*Sqrt[5]] - 0.05;
vv[n_] := v1/s^(n)
g = Table[Line[{1, n}], {n, 2, 6}];
vv1[n_] := v/s^(n)
g1 = Table[
   Graphics[
    GraphicsComplex[Table[vv[1][[m]] + {-x1[n], y1[n]}/2, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
g2 = Graphics[
  GraphicsComplex[v, Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]]
Show[{g1, g2}]
g3 = Table[
   Graphics[
    GraphicsComplex[
     Table[vv1[2][[m]] + {-x[n], -y[n]}/2.9, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
g4 = Table[
   Graphics[
    GraphicsComplex[
     Table[vv1[2][[m]] + {x2[n], y2[n]}/2.1, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
g5 = Table[
   Graphics[
    GraphicsComplex[
     Table[vv1[2][[m]] - {x2[n], y2[n]}/2.1, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
g6 = Table[
   Graphics[
    GraphicsComplex[
     Table[vv1[2][[m]] + {x3[n], y3[n]}/1.59, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
g7 = Table[
   Graphics[
    GraphicsComplex[
     Table[vv1[2][[m]] + {x3[n], -y3[n]}/1.58, {m, 1, 6}],
     Join[g, {Line[{2, 3, 4, 5, 6, 2}]}]]], {n, 1, 5}];
Show[{g1, g2, g3, g4, g5, g6, g7}]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web