Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5358 > unrolled thread
| Started by | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| First post | 2011-10-04 05:36 +0000 |
| Last post | 2011-10-04 05:36 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Simple fractal Heike Gramberg <heike.gramberg@gmail.com> - 2011-10-04 05:36 +0000
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Date | 2011-10-04 05:36 +0000 |
| Subject | Re: Simple fractal |
| Message-ID | <j6e60e$kce$1@smc.vnet.net> |
You could do something like this:
Manipulate[
Module[{pts = N@Table[{Cos[i*360./sides*Degree],
Sin[i*360./sides*Degree]}, {i, sides}]},
Graphics[{FaceForm[Opacity[0]], EdgeForm[Black],
NestList[ Translate[Scale[#, scale, {0, 0}], dist pts] &,
{Polygon[pts]}, depth]}]],
{{sides, 3}, Range[3, 6]},
{{scale, 0.5}, 0, 1},
{{dist, 1}, 0, 2},
{{depth, 2}, Range[7]}]
Heike
On 2 Oct 2011, at 08:36, Tom De Vries wrote:
> I am trying to create a very simple fractal, but I am not having any success.
>
> I'd like to learn how to do this recursively, and hoping someone can
> give me a bit of a push in the right direction.
>
> It's a simple triangle with triangles at each corner, with triangles
> at each corner, etc.
>
> Below, a simple "level 1" graphic.
>
> scale = 0.5;
>
> list1 = Table[{0, 0} + {Cos[i*120*Degree], Sin[i*120*Degree]}, {i,
1,
> sides + 1}];
>
> list2 = (Table[#1 + scale*{Cos[i*120*Degree], Sin[i*120*Degree]},
{i,
> 1, sides + 1}] & ) /@ list1;
>
> Graphics[{Line[list1], Line[list2]}]
>
>
> Ideally I'd like to have a Manipulate with a slider for the level of
> the fractal, the scale applied to each level, and the distance each
> corner triangle is from the centre triangle.
>
> Sorry, I know this is simple programming, but I don't have any ideas
> how to start.
>
> Tom De Vries
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web