{"id":484,"date":"2007-08-06T16:59:00","date_gmt":"2007-08-06T16:59:00","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/08\/06\/the-sierpinski-gasket-by-affine\/"},"modified":"2007-08-06T16:59:00","modified_gmt":"2007-08-06T16:59:00","slug":"the-sierpinski-gasket-by-affine","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/08\/06\/the-sierpinski-gasket-by-affine\/","title":{"rendered":"The Sierpinski Gasket by Affine"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"sier-shear.png\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_237.png?resize=204%2C187\" width=\"204\" height=\"187\" class=\"inset right\" \/><\/p>\n<p> So, in my last post, I promised to explain how the chaos game is is an attractor for the Sierpinski triangle. It&#8217;s actually pretty simple. First, though, we&#8217;ll introduce the idea of an <em>affine transformation<\/em>. Affine transformations aren&#8217;t strictly necessary for understanding the Chaos game,  but by understanding the Chaos game in terms of affines, it makes it easier to understand<br \/>\nother attractors.<\/p>\n<p><!--more--><\/p>\n<p> An affine transformation is a simple set of linear equations which has the effect of doing a simple<br \/>\nscaling of any geometric figure put through it. <\/p>\n<p> So, for a two-dimensional affine transformation, there are two linear equations &#8211; one for each<br \/>\ndimension. Each does a scaling in a different direction &#8211; the X equation scales a figure horizontally; the Y equation scales vertically. What it means to apply a transformation T to a figure F is to take each point p=(x,y)&isin;F, and use the transform to compute a new point p&#8217;=(x&#8217;,y&#8217;)=T(x,y). The transform F&#8217; of F is the set of points p&#8217;. p&#8217; is called the <em>image<\/em> of p under T; F&#8217; is the image of F under T.<\/p>\n<p> An affine transformation in a plane is a pair of linear equations &#8211; one for computing the new X value after the transformation; the other for computing the new Y value. For example, here&#8217;s an affine transformation A:<\/p>\n<ul>\n<li> x&#8217; = 1\/2x + 0y + 0<\/li>\n<li> y&#8217; = 0x + y + 0<\/li>\n<\/ul>\n<p> If we take a square, and apply A to it, here&#8217;s what happens: it scales it in half horizontally, and leaves it unchanged vertically.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"scale.png\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_238.png?resize=288%2C147\" width=\"288\" height=\"147\" \/><\/p>\n<p> Affine transformations, in general, can do any combination of dilation (scaling),<br \/>\nrotation, shear, or translation (moving). The chaos game is basically three<br \/>\ndifferent affine scaling transformations. The translation of points to the midpoint of the line between a point and a vertex of the triangle essentially select points near corner points<br \/>\nof triangles. The triangles that attract points are triangles 1\/2, 1\/4, 1\/8, &#8230;, the size of the original triangle <em>because<\/em> the affine transformations do a 1\/2 scaling. <\/p>\n<p> So &#8211; you start at a random point within your triangle. Then you pick an affine which scales and translates towards one vertex. That moves your point towards a corner vertex of some triangle. That first translated point may not be very close to an actual member of the Sierpinski set &#8211; for example, if the initial point was in the middle of the white space in the center of the triangle. But each iteration, each application of one of the three affines, will move it closer. <\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" alt=\"seir-attractor-affine.png\" src=\"https:\/\/i0.wp.com\/scientopia.org\/img-archive\/goodmath\/img_239.png?resize=216%2C162\" width=\"216\" height=\"162\" class=\"inset right\" \/><\/p>\n<p> So imagine you&#8217;ve got an initial point, and you apply the affine towards one vertex of the triangle. You&#8217;ll get points along the red lines in this figure. If you use the affine towards a different vertex,<br \/>\nyou&#8217;ll get points on the green colored lines. Looking at those two, you can see the beginnings of<br \/>\nwhere the gasket is going to come from &#8211; those two are sets of lines are starting to draw triangles within larger triangles. But using those two affines, you&#8217;ll just keep getting smaller, and closer to the<br \/>\nbottom edge of the enclosing triangle &#8211; the smallest triangles will only be in the bottom row. <\/p>\n<p> There&#8217;s one more bit left. The third vertex.<\/p>\n<p> If you alternate between any two vertices, you&#8217;ll get the edge-approaching scenario we saw above. To get beyond that, we use the third vertex. Basically, at any moment, you&#8217;re defining points of line parallel to the edge of the triangle connecting the vertices used for the new point, and the point before it; and you&#8217;re shifting the line closer to that edge &#8211; and that&#8217;s the same thing as moving it <em>away<\/em> from<br \/>\nthe third vertex. So doing A,B,A,B,A,B gives you smaller triangles close to the A\/B edge of the triangle. Then doing A,C pulls the points away from C, and close to the center &#8211; drawing the points to form edges of smaller triangles parallel to the A,C edge of the triangle. So there&#8217;s a constant motion in and out towards the vertices &#8211; closer to any pair of vertices means farther away from the third. And since the three are being selected randomnly, over time, we expect to fill in points in every region.<\/p>\n<p> The key to understanding it are to know what the affine transformations are doing; and to understand<br \/>\nthe pattern of their invocation and how that will cause them to interact. If you switch gears, and look at the affines for the Fern, you can see what they&#8217;re doing &#8211; variations<br \/>\non translations and rotations in the different directions of the branches of the ferns. You can trace out lines like the ones I used for the gasket, except that they&#8217;ll be more complicated, because of the combination of translations and rotations in the affine transformations of the Fern attractor. The Fern is a lot harder &#8211; but it still just comes down to understanding the effects of the individual affines, and then putting it together with the invocation pattern.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, in my last post, I promised to explain how the chaos game is is an attractor for the Sierpinski triangle. It&#8217;s actually pretty simple. First, though, we&#8217;ll introduce the idea of an affine transformation. Affine transformations aren&#8217;t strictly necessary for understanding the Chaos game, but by understanding the Chaos game in terms of affines, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[86],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-fractals"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-7O","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}