Application Center - Maplesoft

App Preview:

Some Fractals with Maple

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application

Some Fractals with Maple


Miriam Ciavarella

Università degli Studi di Torino



Marina Marchisio

Università degli Studi di Torino








This paper contains some procedures concerning the fractals.

In particular we describe the procedures in order to draw  the triadic Cantor dust, the Koch curve, the Snowflake and the procedures in order to calculate the area and the perimeter of the Snowflake curve.


The idea of this procedures was born during a tutorial of Maple that we made for students in Mathematics of the first year of the University of Turin. They were interested in learning how to write procedures with Maple but also in working  with objects different from the ones of the classical geometry. Fractals appeared to us as the right geometric objects with surprising properties.

We consider the fractals just as subsets of two-dimensional Euclidean space.


Triadic Cantor Dust


In the nineteenth century mathematician Georg Cantor became fascinated by the infinite number of points on a line segment and studied this new set.


To generate the triadic Cantor dust start with a closed interval [0,1] (includes the points 0 and 1). At the first iteration replace the interval with 3 equal length pieces and remove the middle third, or ]1/3, 2/3[ (excludes the points 1/3 and 2/3).

Subsequent iterations involve removing the middle portion of the remaining line segments.

The gap removed each time is usually called a trema from the Latin tremes = termite.

The triadic Cantor dust, as the name says, is the limit of this construction applying an infinite number of times, at the iteration k it is the remaining line segments after the k remotions.

We note that this fractal is defined recursively.


It follows immediately the procedure which draws  the triadic Cantor dust giving as input the integer number k which is the step that we want to reach.










In the examples before we note  that, already with k = 10, we obtain as representation of the fractal of Cantor a list of points, a "real dust". The total lenght of the Cantor dust itself is zero. The power of geometric visualization of Maple allow us, by this procedure, to draw easily this fractal easily at step k >> 0.


Koch Curve

The Koch curve appeared in a 1904 paper titled "On a continuous curve without tangents, constructible from elementary geometry" (original French title: "Sur une courbe continue sans tangente, obtenue par une construction géométrique élémentaire") by the Swedish mathematician Helge von Koch.

Let us recall the construction of the Koch curve. Start with a segment of lenght 1; divide it into three equal segments and replace the middle segment by the two sides of an equilateral triangle of the same length as the segment being removed. Now repeat this construction, taking each of the four resulting segments, dividing them into three equal parts and replacing each of the middle segments by two sides of an equilateral triangle as before. Continue this construction: the Koch curve is the limiting curve obtained by applying this construction an infinite number of times.

The following procedure, returns the picture of the curve obtained by applying a finite number of times the construction above.

Input datum is an integer number which is the step of the finite construction.  









We can note that already at the step 4 we obtain a nice and rich poligonal!


Snowflake Curve

The Koch snowflake is a simple close curve and one of the earliest fractal curves to have been described. It can be constructed by starting with an equilateral triangle, then recursively on each line segment by drawing the Koch curve. Sometimes it is used as example of a curve of infinite length surrounding a finite area.

The following procedure allow us to draw it at the step m, the integer number we have to give as input.




At step m=0, the Koch snowflake is an equilateral triangle.




After one iteration, the result is a shape similar to the Star of David.



















We are interested to write simple procedures that calculate the area of the region inside the snowflake curve and its perimeter. Of course we expect that the first one tend to a finite value and the second one tends to infinite.


Area of the Region Inside the Fractal Snowflake Curve


The imput of the following procedure is again a positive integer n which tells to Maple how many steps calculate.

The output is the area at each step and it is approximated at 7 decimal digits.




Perimeter of the Fractal Snowflake Curve


The imput of the following procedure is again a positive integer n which tells to Maple how many steps calculate.

The output is the perimeter at each step and it is approximated again at 7 decimal digits.










At step n 

the perimeter is:       

and the area is:    


We can define the functions in x:




and if we calculate the limits for x tending to infinite we obtain as we expected:








Gerald A.Edgar, Measure, Topology, and Fractal Geometry, Springer-Verlag, New York, Berlin, 1990.



Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2009. Maplesoft and Maple are trademarks of Waterloo Maple Inc. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material.  This application is intended for non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.