GSP - Sierpinski Gasket Script Description

Given:

1. Point A

2. Point B

3. Point C

Steps:

1. Let [j] = Segment between Point B and Point A (hidden).

2. Let [k] = Segment between Point C and Point B (hidden).

3. Let [l] = Segment between Point A and Point C (hidden).

4. Let [D] = Midpoint of Segment [k] (hidden).

5. Let [E] = Midpoint of Segment [j] (hidden).

6. Let [F] = Midpoint of Segment [l] (hidden).

7. Let [p1] = Polygon interior with vertices A, B and C (medium, hidden).

8. Let [p2] = Polygon interior with vertices A, [E] and [F] (solid, red).

9. Let [p3] = Polygon interior with vertices [E], B and [D] (solid, red).

10. Let [p4] = Polygon interior with vertices [F], [D] and C (solid, red).

11. Recurse on A, [E] and [F].

12. Recurse on [E], B and [D].

13. Recurse on [F], [D] and C.

In Step#7, we create the big triangle ABC---and then hide it. Steps 8, 9, and 10 construct smaller triangles---and steps 11, 12, and 13 recurse on these smaller triangles. Now consider a single recursion on one of the small ones---when we get to step 7 a second time, the big triangle ABC that we request to construct and hide is actually one of the small triangles created at the previous depth of the script. Sketchpad goes ahead and hides it (because it was created by this script itself), and then goes on to construct the next-smaller triangles. At the end of the script playback, only the smallest triangles constructed at the last depth of recursion reached are still visible!

Click the GSP button to access the GSP sample script


Return