Report Tool or Give Us Suggestions

Sierpinski Square Generator

Generate and render beautiful Sierpinski square curve fractals in square or rhombus form with custom styling, neon glow, and animation.

L ading . . .

Understanding the Sierpinski Square Curve: An Additive L-System Fractal

While the famous Sierpinski Carpet is a subtractive fractal created by cutting holes out of a solid square, the Sierpinski Square Curve is a continuous, self-similar closed curve that grows recursively from the boundaries of a starting square. Using a 90-degree Lindenmayer system (L-System), this generator traces a single continuous path that outlines an incredibly intricate space-filling boundary.

How the L-System Algorithm Works

An L-system is a formal grammar consisting of an alphabet of symbols, a starting string (axiom), and a set of production rules that dictate how each symbol expands in the next generation. The Sierpinski Square Curve is constructed using the following rules:

L-System Representation:
Axiom (Start): XF + XF + XF + XF
Production Rule: X → XF - F + F - XF + F + XF - F + F - X
Angle: 90°
Interpretation:
  - F: Move forward by step size $u$, drawing a segment.
  - +: Turn left by 90°.
  - -: Turn right by 90°.
  - X: A placeholder symbol for recursive expansion (does not draw).

Square Form vs. Rhombus Form

Depending on the initial orientation of the starting square, the fractal is rendered in two major visual representations:

  • Square Form: Drawn with an initial rotation of $0^\circ$. The main outline aligns horizontally and vertically with the canvas boundaries.
  • Rhombus Form (Diamond): Drawn with an initial rotation of $45^\circ$. This creates a rotated diamond-like shape that reveals beautiful diagonal symmetries as the recursion depth increases.

Comparison: Sierpinski Carpet vs. Sierpinski Square

Although their names sound highly similar, they represent completely different mathematical approaches to space-filling geometry:

Property Sierpinski Carpet Sierpinski Square Curve
Type of Fractal Area Fractal (Subtractive) Boundary Curve (Additive / Space-Filling)
Construction Method Recursively remove center 1/9th squares L-System replacement rules at 90° angles
Continuity Discontinuous grid of squares Strictly continuous, closed single path
Self-Intersection N/A (2D shape) Strictly non-self-intersecting

Frequently Asked Questions

Frequently Asked Questions

What is the difference between the Sierpinski Square Curve and the Sierpinski Curve?

The standard Sierpinski Curve (Wirth's mutual recursion) is a closed space-filling curve that contains diagonal segments at $45^\circ$ angles. In contrast, the Sierpinski Square Curve is constructed purely on a square grid using 90-degree angles, creating orthogonal stepped segments that grow outward and inward exclusively.

How many segments are in a Sierpinski Square Curve of order n?

As the recursion depth (order) $n$ increases, the number of individual line segments grows exponentially. At order 0, it is a simple 4-segment square. At order 1, it grows to 36 segments. For order $n$, the number of segments is given by the recursive expansion of the rules, resulting in thousands of vertices at order 4.

Why is the area of a perfect space-filling curve considered to be zero?

Mathematically, a curve is a one-dimensional object. Even if the path becomes infinitely dense and passes through every point of a two-dimensional region (thus filling the space), the actual 2D Lebesgue measure (area) of the line itself remains exactly zero because a mathematical line has width equal to zero.

logo OnlineMiniTools

OnlineMiniTools.com is your ultimate destination for a wide range of web-based tools, all available for free.

Feel free to reach out with any suggestions or improvements for any tool at admin@onlineminitools.com. We value your feedback and are continuously striving to enhance the tool's functionality.

© 2026 OnlineMiniTools . All rights reserved.

Hosted on Hostinger

v1.10.0