![]() |
Python_2
1.0
|
Draws a Sierpinski Gasket. More...
Functions | |
def | Sierpinski (a, b, c, n, fourth=False) |
Creates a Sierpinski Gasket, by recursively partitioning an initial triangle (a,b,c) into three or four new triangles. More... | |
def | draw (c, points, contour=False) |
Draw triangles, given in points, on canvas c. More... | |
def | main (argv=None) |
Main program. More... | |
Draws a Sierpinski Gasket.
Usage: _16_sierpinski [number_of_divisions]
def _16_sierpinski_gasket.draw | ( | c, | |
points, | |||
contour = False |
|||
) |
Draw triangles, given in points, on canvas c.
Referenced by main().
def _16_sierpinski_gasket.main | ( | argv = None | ) |
Main program.
References draw(), _08b_clock_bezier.resize, and Sierpinski().
def _16_sierpinski_gasket.Sierpinski | ( | a, | |
b, | |||
c, | |||
n, | |||
fourth = False |
|||
) |
Creates a Sierpinski Gasket, by recursively partitioning an initial triangle (a,b,c) into three or four new triangles.
a | first vertex coordinates. |
b | second vertex coordinates. |
c | third vertex coordinates. |
n | number of subdivisions on each edge (depth of recursion). |
fourth | whether to add the fourth triangle. |
Referenced by main().