Simple Fractal square
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I am working on a math question about infinite series, and one of the question images is below.
Each new white square has an area that is 1/4 of the previous square.
Always looking to learn elegant ways to create things using Mathematica, and in this case, probably recursion as well?
I know it's not complicated, but any help with the process would be appreciated.
Having a NICE diagram really helps with creating a better response.
(questions about sums of areas of white, black, etc.)
graphics recursion iteration
add a comment |Â
up vote
3
down vote
favorite
I am working on a math question about infinite series, and one of the question images is below.
Each new white square has an area that is 1/4 of the previous square.
Always looking to learn elegant ways to create things using Mathematica, and in this case, probably recursion as well?
I know it's not complicated, but any help with the process would be appreciated.
Having a NICE diagram really helps with creating a better response.
(questions about sums of areas of white, black, etc.)
graphics recursion iteration
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am working on a math question about infinite series, and one of the question images is below.
Each new white square has an area that is 1/4 of the previous square.
Always looking to learn elegant ways to create things using Mathematica, and in this case, probably recursion as well?
I know it's not complicated, but any help with the process would be appreciated.
Having a NICE diagram really helps with creating a better response.
(questions about sums of areas of white, black, etc.)
graphics recursion iteration
I am working on a math question about infinite series, and one of the question images is below.
Each new white square has an area that is 1/4 of the previous square.
Always looking to learn elegant ways to create things using Mathematica, and in this case, probably recursion as well?
I know it's not complicated, but any help with the process would be appreciated.
Having a NICE diagram really helps with creating a better response.
(questions about sums of areas of white, black, etc.)
graphics recursion iteration
graphics recursion iteration
asked 1 hour ago
Tom De Vries
1,6351224
1,6351224
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
coords = 0, 0, 0, 1, 1, 1, 1, 0;
tf = Composition[TranslationTransform[1/2, 0], ScalingTransform[1/2, 1/2]]
rects = NestList[tf /@ ## &, coords, 4];
Graphics[ EdgeForm[Black], Rectangle,
FaceForm[Gray], Polygon@#, FaceForm[White], Polygon@#2 & @@@
Transpose[rects, Most /@ rects], FaceForm[White], Polygon[Last@rects]]
add a comment |Â
up vote
1
down vote
n = 100;
T1 = Developer`ToPackedArray[-1., 0., -0.5, 0., -0.5, 0.5];
T2 = Developer`ToPackedArray[-0.5, 0.5, 0., 0.5, 0., 1.];
Graphics[
Polygon[Table[0.5^k T1, k, 0, n]],
Polygon[Table[0.5^k T2, k, 0, n]]
]
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
coords = 0, 0, 0, 1, 1, 1, 1, 0;
tf = Composition[TranslationTransform[1/2, 0], ScalingTransform[1/2, 1/2]]
rects = NestList[tf /@ ## &, coords, 4];
Graphics[ EdgeForm[Black], Rectangle,
FaceForm[Gray], Polygon@#, FaceForm[White], Polygon@#2 & @@@
Transpose[rects, Most /@ rects], FaceForm[White], Polygon[Last@rects]]
add a comment |Â
up vote
3
down vote
coords = 0, 0, 0, 1, 1, 1, 1, 0;
tf = Composition[TranslationTransform[1/2, 0], ScalingTransform[1/2, 1/2]]
rects = NestList[tf /@ ## &, coords, 4];
Graphics[ EdgeForm[Black], Rectangle,
FaceForm[Gray], Polygon@#, FaceForm[White], Polygon@#2 & @@@
Transpose[rects, Most /@ rects], FaceForm[White], Polygon[Last@rects]]
add a comment |Â
up vote
3
down vote
up vote
3
down vote
coords = 0, 0, 0, 1, 1, 1, 1, 0;
tf = Composition[TranslationTransform[1/2, 0], ScalingTransform[1/2, 1/2]]
rects = NestList[tf /@ ## &, coords, 4];
Graphics[ EdgeForm[Black], Rectangle,
FaceForm[Gray], Polygon@#, FaceForm[White], Polygon@#2 & @@@
Transpose[rects, Most /@ rects], FaceForm[White], Polygon[Last@rects]]
coords = 0, 0, 0, 1, 1, 1, 1, 0;
tf = Composition[TranslationTransform[1/2, 0], ScalingTransform[1/2, 1/2]]
rects = NestList[tf /@ ## &, coords, 4];
Graphics[ EdgeForm[Black], Rectangle,
FaceForm[Gray], Polygon@#, FaceForm[White], Polygon@#2 & @@@
Transpose[rects, Most /@ rects], FaceForm[White], Polygon[Last@rects]]
edited 4 mins ago
answered 14 mins ago
kglr
167k8188390
167k8188390
add a comment |Â
add a comment |Â
up vote
1
down vote
n = 100;
T1 = Developer`ToPackedArray[-1., 0., -0.5, 0., -0.5, 0.5];
T2 = Developer`ToPackedArray[-0.5, 0.5, 0., 0.5, 0., 1.];
Graphics[
Polygon[Table[0.5^k T1, k, 0, n]],
Polygon[Table[0.5^k T2, k, 0, n]]
]
add a comment |Â
up vote
1
down vote
n = 100;
T1 = Developer`ToPackedArray[-1., 0., -0.5, 0., -0.5, 0.5];
T2 = Developer`ToPackedArray[-0.5, 0.5, 0., 0.5, 0., 1.];
Graphics[
Polygon[Table[0.5^k T1, k, 0, n]],
Polygon[Table[0.5^k T2, k, 0, n]]
]
add a comment |Â
up vote
1
down vote
up vote
1
down vote
n = 100;
T1 = Developer`ToPackedArray[-1., 0., -0.5, 0., -0.5, 0.5];
T2 = Developer`ToPackedArray[-0.5, 0.5, 0., 0.5, 0., 1.];
Graphics[
Polygon[Table[0.5^k T1, k, 0, n]],
Polygon[Table[0.5^k T2, k, 0, n]]
]
n = 100;
T1 = Developer`ToPackedArray[-1., 0., -0.5, 0., -0.5, 0.5];
T2 = Developer`ToPackedArray[-0.5, 0.5, 0., 0.5, 0., 1.];
Graphics[
Polygon[Table[0.5^k T1, k, 0, n]],
Polygon[Table[0.5^k T2, k, 0, n]]
]
answered 6 mins ago
Henrik Schumacher
42.8k261127
42.8k261127
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184560%2fsimple-fractal-square%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password