Fractal Geometry: Iterative Construction of the Sierpinski Carpet
2020-04-05 01:42
This example demonstrates the iterative generation of the classic Sierpinski Carpet fractal. Using GeoGebra commands like Polygon, Dilate, Sequence, and Zip, it shows how to continuously hollow out the center and scale down an initial square to construct a self-similar fractal structure. The model intuitively presents iterations and limits in fractal geometry, ideal for exploring geometric transfo
In collections
GeoGebra & Junior High Math Integration
<?xml version="1.0" encoding="utf-8"?>
<geogebra format="5.0" version="5.0.574.0" app="classic" platform="d" id="b946b0a8-91f7-4b5b-b4ce-a294bc1167e2" xsi:noNamespaceSchemaLocation="http://www.geogebra.org/apps/xsd/ggb.xsd" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<gui>
<window width="1440" height="860" />
<perspectives>
<perspective id="tmp">
<panes>
<pane location="" divider="0.2465277777777778" orientation="1" />
</panes>
<views>
<view id="4" toolbar="0 || 2020 , 2021 , 2022 , 66 || 2001 , 2003 , 2002 , 2004 , 2005 || 2040 , 2041 , 2042 , 2044 , 2043" visible="false" inframe="false" stylebar="true" location="1,1" size="564" window="100,100,600,400" />
<view id="8" toolbar="1001 | 1002 | 1003 || 1005 | 1004 || 1006 | 1007 | 1010 || 1008 1009 || 66 68 || 6" visible="false" inframe="false" stylebar="true" location="1,3" size="300" window="100,100,600,400" />
<view id="1" visible="true" inframe="false" stylebar="true" location="1" size="1424" window="100,100,600,400" />
<view id="2" visible="false" inframe="false" stylebar="true" location="3" size="355" window="100,100,600,400" />
<view id="16" visible="false" inframe="false" stylebar="true" location="1" size="399" window="50,50,500,500" />
<view id="32" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="64" toolbar="0" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="4097" visible="false" inframe="true" stylebar="true" location="1" size="939" window="193,153,863,506" />
<view id="70" toolbar="0 || 2020 || 2021 || 2022" visible="false" inframe="false" stylebar="true" location="1" size="150" window="50,50,500,500" />
<view id="512" toolbar="0 | 1 501 5 19 , 67 | 2 15 45 18 , 7 37 | 514 3 9 , 13 44 , 47 | 16 | 551 550 11 , 20 22 21 23 , 55 56 57 , 12 | 69 | 510 511 , 512 513 | 533 531 , 534 532 , 522 523 , 537 536 , 535 | 521 520 | 36 , 38 49 560 | 571 30 29 570 31 33 | 17 | 540 40 41 42 , 27 28 35 , 6 , 502" visible="false" inframe="false" stylebar="true" location="1" size="1576" window="100,100,600,400" />
</views>
<toolbar show="true" items="0 39 73 62 | 1 501 67 , 5 19 , 72 75 76 | 2 15 45 , 18 65 , 7 37 | 4 3 8 9 , 13 44 , 58 , 47 | 16 51 64 , 70 | 10 34 53 11 , 24 20 22 , 21 23 | 55 56 57 , 12 | 36 46 , 38 49 50 , 71 14 68 | 30 29 54 32 31 33 | 25 17 26 60 52 61 | 40 41 42 , 27 28 35 , 6 | | 100014 100014 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100013" position="1" help="false" />
<input show="true" cmd="true" top="false" />
<dockBar show="false" east="false" />
</perspective>
</perspectives>
<labelingStyle val="3"/>
<font size="16"/>
<consProtColumns col0="true" col1="true" col2="false" col3="true" col4="false" col5="true" col6="true" col7="false"/>
<consProtocol useColors="true" addIcons="false" showOnlyBreakpoints="false"/>
<consProtNavigationBar id="4" playButton="true" playDelay="2.0" protButton="true" consStep="26"/>
</gui>
<euclidianView>
<viewNumber viewNo="1"/>
<size width="1424" height="679"/>
<coordSystem xZero="421.5170386567108" yZero="467.96935902040616" scale="42.8940562428213" yscale="42.89405624282113"/>
<evSettings axes="false" grid="false" gridIsBold="false" pointCapturing="3" rightAngleStyle="1" checkboxSize="26" gridType="0"/>
<bgColor r="0" g="0" b="0"/>
<axesColor r="0" g="0" b="0"/>
<gridColor r="192" g="192" b="192"/>
<lineStyle axes="9" grid="0"/>
<axis id="0" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true" tickDistance="1.0" tickExpression="1"/>
<axis id="1" show="false" label="" unitLabel="" tickStyle="1" showNumbers="true" tickDistance="1.0" tickExpression="1"/>
</euclidianView>
<spreadsheetView>
<prefCellSize height="29"/>
<spreadsheetColumn id="0" width="382"/>
<layout showFormulaBar="true" showGrid="true" showHScrollBar="true" showVScrollBar="true" showColumnHeader="true" showRowHeader="true" allowToolTips="true" autoComplete="true"/>
</spreadsheetView>
<algebraView>
<mode val="1"/>
</algebraView>
<kernel>
<continuous val="false"/>
<usePathAndRegionParameters val="true"/>
<decimals val="2"/>
<angleUnit val="degree"/>
<algebraStyle val="2" spreadsheet="0"/>
<coordStyle val="0"/>
</kernel>
<tableview min="-2.0" max="2.0" step="1.0"/>
<scripting blocked="false" disabled="false"/>
<construction title="" author="" date="">
<expression label="A" exp="(0, 8)" type="point"/>
<element type="point" label="A">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="0.0" y="8.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="B" exp="(-5, 0)" type="point"/>
<element type="point" label="B">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="-5.0" y="0.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<expression label="C" exp="(5, 0)" type="point"/>
<element type="point" label="C">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<animation step="1" speed="1" type="1" playing="false"/>
<coords x="5.0" y="0.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Polygon">
<input a0="A" a1="B" a2="C"/>
<output a0="t1" a1="c" a2="a" a3="b"/>
</command>
<element type="polygon" label="t1">
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<show object="false" label="false" ev="4"/>
<objColor r="0" g="255" b="0" alpha="0.03999999910593033"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<element type="segment" label="c">
<show object="false" label="false"/>
<objColor r="0" g="255" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="8.0" y="-5.0" z="40.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<element type="segment" label="a">
<show object="false" label="false"/>
<objColor r="0" g="255" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="0.0" y="10.0" z="-0.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<element type="segment" label="b">
<show object="false" label="false"/>
<objColor r="0" g="255" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="-8.0" y="-5.0" z="40.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<command name="Dilate">
<input a0="A" a1="0.5" a2="A"/>
<output a0="A'"/>
</command>
<element type="point" label="A'">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="0.0" y="8.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Dilate">
<input a0="B" a1="0.5" a2="A"/>
<output a0="B'"/>
</command>
<element type="point" label="B'">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="-2.5" y="4.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Dilate">
<input a0="C" a1="0.5" a2="A"/>
<output a0="C'"/>
</command>
<element type="point" label="C'">
<show object="false" label="true"/>
<objColor r="77" g="77" b="255" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<coords x="2.5" y="4.0" z="1.0"/>
<pointSize val="5"/>
<pointStyle val="0"/>
</element>
<command name="Polygon">
<input a0="A'" a1="B'" a2="C'"/>
<output a0="t1'" a1="c'" a2="a'" a3="b'"/>
</command>
<element type="polygon" label="t1'">
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<show object="false" label="false"/>
<objColor r="153" g="51" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="0"/>
</element>
<element type="segment" label="c'">
<show object="false" label="false"/>
<objColor r="153" g="51" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="4.0" y="-2.5" z="20.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<element type="segment" label="a'">
<show object="false" label="false"/>
<objColor r="153" g="51" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="0.0" y="5.0" z="-20.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<element type="segment" label="b'">
<show object="false" label="false"/>
<objColor r="153" g="51" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="false"/>
<coords x="-4.0" y="-2.5" z="20.0"/>
<lineStyle thickness="5" type="0" typeHidden="1" opacity="178"/>
<outlyingIntersections val="false"/>
<keepTypeOnTransform val="true"/>
</element>
<expression label="L" exp="{A, B, C}" />
<element type="list" label="L">
<show object="true" label="false"/>
<objColor r="0" g="100" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Sequence">
<input a0="Polygon[Dilate[A, 0.5, Element[L, n]], Dilate[B, 0.5, Element[L, n]], Dilate[C, 0.5, Element[L, n]]]" a1="n" a2="1" a3="3"/>
<output a0="l1"/>
</command>
<element type="list" label="l1">
<show object="false" label="false"/>
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="0"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<expression label="A1" exp="{A, B, C}" />
<element type="list" label="A1">
<show object="false" label="false"/>
<objColor r="0" g="0" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Zip">
<input a0="Polygon[Dilate[A, 0.5, S], Dilate[B, 0.5, S], Dilate[C, 0.5, S]]" a1="S" a2="L"/>
<output a0="A2"/>
</command>
<element type="list" label="A2">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B2"/>
<objColor r="0" g="100" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Zip">
<input a0="Dilate[A2, 0.5, S]" a1="S" a2="L"/>
<output a0="A3"/>
</command>
<element type="list" label="A3">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B3"/>
<objColor r="0" g="100" b="0" alpha="0.09804" dynamicr="sin(B3)" dynamicg="0.8" dynamicb="0.5" dynamica="0.09804" colorSpace="2"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Zip">
<input a0="Dilate[A3, 0.500000000000002, S]" a1="S" a2="L"/>
<output a0="A4"/>
</command>
<element type="list" label="A4">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B4"/>
<objColor r="0" g="100" b="0" alpha="0.0980400000000002" dynamicr="sin(B4)" dynamicg="0.800000000000002" dynamicb="0.500000000000002" dynamica="0.0980400000000002" colorSpace="2"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<command name="Zip">
<input a0="Dilate[A4, 0.500000000000002, S]" a1="S" a2="L"/>
<output a0="A5"/>
</command>
<element type="list" label="A5">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B5"/>
<objColor r="0" g="100" b="0" alpha="0.0980400000000002" dynamicr="sin(B5)" dynamicg="0.800000000000002" dynamicb="0.500000000000002" dynamica="0.0980400000000002" colorSpace="2"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<element type="numeric" label="n">
<value val="7.0"/>
<show object="true" label="true"/>
<objColor r="255" g="0" b="0" alpha="0.10000000149011612"/>
<bgColor r="160" g="160" b="160" alpha="255"/>
<layer val="0"/>
<labelMode val="1"/>
<slider min="2" max="7" absoluteScreenLocation="true" width="100.0" x="592.0" y="615.0" fixed="false" horizontal="true" showAlgebra="true"/>
<lineStyle thickness="10" type="0" typeHidden="1"/>
<animation step="1" speed="1" type="0" playing="false"/>
</element>
<expression label="B1" exp="1"/>
<element type="numeric" label="B1">
<value val="1.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<expression label="B2" exp="2"/>
<element type="numeric" label="B2">
<value val="2.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<expression label="B3" exp="3"/>
<element type="numeric" label="B3">
<value val="3.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<expression label="B4" exp="4"/>
<element type="numeric" label="B4">
<value val="4.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<expression label="B5" exp="5"/>
<element type="numeric" label="B5">
<value val="5.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<command name="Zip">
<input a0="Dilate[A5, 0.500000000000002, S]" a1="S" a2="L"/>
<output a0="A6"/>
</command>
<element type="list" label="A6">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B6"/>
<objColor r="0" g="100" b="0" alpha="0.0980400000000002" dynamicr="sin(B6)" dynamicg="0.800000000000002" dynamicb="0.500000000000002" dynamica="0.0980400000000002" colorSpace="2"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<expression label="B6" exp="6"/>
<element type="numeric" label="B6">
<value val="6.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<command name="Zip">
<input a0="Dilate[A6, 0.500000000000004, S]" a1="S" a2="L"/>
<output a0="A7"/>
</command>
<element type="list" label="A7">
<show object="true" label="false" ev="4"/>
<condition showObject="n ≥ B7"/>
<objColor r="0" g="100" b="0" alpha="0.0980400000000004" dynamicr="sin(B7)" dynamicg="0.800000000000004" dynamicb="0.500000000000004" dynamica="0.0980400000000004" colorSpace="2"/>
<layer val="0"/>
<labelMode val="0"/>
<auxiliary val="true"/>
<lineStyle thickness="5" type="0" typeHidden="1"/>
<pointSize val="5"/>
<angleStyle val="0"/>
</element>
<expression label="B7" exp="7"/>
<element type="numeric" label="B7">
<value val="7.0"/>
<show object="false" label="true"/>
<objColor r="0" g="0" b="0" alpha="0.10000000149011612"/>
<layer val="0"/>
<labelMode val="1"/>
<animation step="0.1" speed="1" type="0" playing="false"/>
<auxiliary val="true"/>
</element>
<expression label="text1" exp=""【分形图形】迭代-谢尔宾斯基地毯""/>
<element type="text" label="text1">
<show object="true" label="false" ev="40"/>
<objColor r="255" g="255" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="2.0" size="16" style="0"/>
<startPoint x="-8.055126255739363" y="10.21049062231567" z="1.0"/>
</element>
<expression label="text2" exp=""原创:孟宝兴
制作:刘护灵 (表格迭代+动态颜色)""/>
<element type="text" label="text2">
<show object="true" label="false" ev="40"/>
<objColor r="255" g="255" b="0" alpha="0.0"/>
<layer val="0"/>
<labelMode val="0"/>
<isLaTeX val="true"/>
<font serif="true" sizeM="1.0" size="0" style="1"/>
<startPoint x="-9.010969642708897" y="-2.9614975151913745" z="1.0"/>
</element>
</construction>
</geogebra>