Fractals

How to Generate a Square Star Fractal Using Recursion

This article is about generating a Square Star Fractal using recursion (Although a triple for-loop implementation is much preferred, it will be discussed separately).

The logic of a Recursive Square Star Fractal Function is a simple Divide and Conquer algorithm. The program is subdivided into smaller tasks until it is solved. The function takes the (X, Y) middle coordinates of the square, R length, where 1 Side of Square = 1 Length = 2R length, and T as the number of times to generate 2R- sized squares. 

Tags:

How to Build a Sierpinski Triangle (Chaos Game)

Today is Throwback Thursday and so I decided to create a simple graphic script using QBASIC - the first programming language I fell in love with in the 90s.

Sierpinski Triangle is a fractal equilateral triangle (60 degrees on each angle with equal length of sides) subdivided recursively into smaller triangles as shown in the figure above.

Although the pattern can be easily created using recursion, our demonstration uses the chaos game approach to construct the triangle.

Tags:

Subscribe to RSS - Fractals