Page 1 of 1 [ 1 post ]

#### Help: Drawing Sierpinski Carpet in mathematica

 Print view Previous topic | Next topic

#### Help: Drawing Sierpinski Carpet in mathematica

Author Message
 Post subject: Help: Drawing Sierpinski Carpet in mathematica  Posted: January 25th, 2017, 10:21 pm

Joined: January 25th, 2017, 10:05 pm
Posts: 1
Dear Planet Chili users, can someone be that kind to help a Polish Student in need? I have to create a function that will draw a sierpinski carpet with vertexes(i dunno if that is clear, my english isnt perfect, what i mean is points around carpet so we can change them and rotate the carpet or expand it) and to a depth given in func. I have a func. done for the Sierpinski triangle, but I dont know how to do it for the carpet can smn pls help? Here's the code for the triangle:

It draws the triangle to a depth that we want and we can manipulate it so it's exactly what i need to have, but i need to have it for the carpet.

Manipulate[
Graphics[{Nest[
Translate[Scale[#, 1/2, {0, 0}], pts/2] &, {Polygon[pts]},
depth]}, PlotRange -> {{0, 1}, {0, 1}},
PlotRangePadding -> .2], {{pts, {{0, 0}, {1, 0}, {1/2, 1}}},
Locator}, {{depth, 4}, Range[7]}]

Display posts from previous:  Sort by

 Page 1 of 1 [ 1 post ]

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

 Search for: