Fractal Patterns: Sierpinski's Triangle and its visualization
Sierpinski's discovery of the Sierpinski Triangle marked a crucial contribution to the study of fractals and has since become an essential example in fractal geometry and chaos theory.
The Sierpinski Triangle, also known as the Sierpinski Sieve, is a fascinating geometric pattern named after the Polish mathematician Wacław Sierpiński. Its history dates back to the early 20th century.
Wacław Sierpiński (1882-1969) was a prominent mathematician who made significant contributions to various areas of mathematics, including set theory, number theory, and topology. The Sierpinski Triangle is one of his most famous creations.
The first published mention of the Sierpinski Triangle appeared in 1915 when Sierpiński presented it as an example of a non-differentiable function. However, it wasn't until 1916 that he explicitly described the self-replicating pattern we now know as the Sierpinski Triangle. He showed how to construct it by recursively removing triangles from an equilateral triangle.
The construction of the Sierpinski Triangle is simple yet remarkable. It starts with a single equilateral triangle. To create the next iteration, one removes an upside-down equilateral triangle from the middle of the original triangle. The process is repeated indefinitely, with each iteration forming smaller triangles. The result is a fractal pattern with a self-replicating, intricate structure.
Sierpiński's work on the triangle was part of his broader research on self-replicating and self-similar structures, which are now known as fractals. His discovery of the Sierpinski Triangle marked a crucial contribution to the study of fractals and has since become an essential example in fractal geometry and chaos theory.
Over the years, Sierpinski's work has inspired mathematicians, artists, and computer scientists, leading to many variations and applications of the Sierpinski Triangle in various fields, including computer graphics, art, and algorithm design.
Today, the Sierpinski Triangle remains a captivating and popular topic in mathematics and serves as a compelling example of the beauty and complexity that can arise from simple iterative processes.
Here’ a visual example of the Sierpinski’s Triangle:
You can try out the animation yourself here: Sierpinski’s Triangle demonstration
INSTRUCTIONS: Just click the mouse and it will show each successive iteration of the animation.
These pictures were made using the JavaScript p5.js framework. Below is the code that describes step by step animation of the Sierpinski’s Triangle. It goes up to 7 iterations.
let level = 7; // Number of recursion levels
let size = 400; // Initial size of the triangle
function setup() {
createCanvas(800, 800);
}
function draw() {
background(255);
drawTriangle(width / 2, height / 2, size, level);
}
function drawTriangle(x, y, size, level) {
if (level === 0) {
// Base case: Draw a single triangle
let h = (sqrt(3) * size) / 2; // Height of the equilateral triangle
let x1 = x - size / 2;
let y1 = y + h / 2;
let x2 = x + size / 2;
let y2 = y + h / 2;
let x3 = x;
let y3 = y - h / 2;
triangle(x1, y1, x2, y2, x3, y3);
} else {
// Recursive case: Divide the triangle into three smaller triangles
let newSize = size / 2;
let newLevel = level - 1;
// Top triangle
drawTriangle(x, y - newSize / 2, newSize, newLevel);
// Bottom left triangle
drawTriangle(x - newSize / 2, y + newSize / 2, newSize, newLevel);
// Bottom right triangle
drawTriangle(x + newSize / 2, y + newSize / 2, newSize, newLevel);
}
}
function mousePressed() {
if (level < 7) {
level++;
} else {
level = 0;
}
}