Questions tagged [fractal]
Fractals are shapes that are self-similar and are usually quite detailed. Well-known fractal sets include the Mandelbrot set, Julia sets, and Phoenix sets. Tree-like fractal drawings are also common.
69 questions
19
votes
5
answers
3k
views
Draw a Fibonacci Swoosh
Title courtesy of Greg Martin
For this challenge, I'll define an arc of size \$k\$ as a single piece of a sine wave with a length of \$k\$ units and an height of \$\frac{k}{4}\$ units:
And I'll ...
17
votes
22
answers
2k
views
Compute this fractal matrix
The unique-disjointness matrix ( UDISJ(n) ) is a matrix on all pairs of subsets of {1...,n} with entries $$ U_{(A,B)}=\begin{cases}
0, ~ if ~ |A\cap B|=1\\
1, ~ ...
16
votes
4
answers
1k
views
Create a triangle whose colors are determined by the bitsums of coordinates
Write a program that, for any \$n\$, generates a triangle made of hexagons as shown, \$2^n\$ to a side. The colors are to be determined as follows.
We may give the triangle barycentric coordinates so ...
17
votes
11
answers
3k
views
Fibonacci word fractal
The Fibonacci word is a sequence of binary strings defined as:
\$F_0 = \$ 0
\$F_1 = \$ 01
\$F_n = F_{n-1} F_{n-2}\$
The first ...
20
votes
6
answers
1k
views
Draw this fractal generated by applying Newton's method to cosh(x) - 1
I came across this picture the other day: (Credit to Josep M Batlle I Ferrer)
Your job is to generate this picture. This graph is generated by repeatedly applying newton's method to the graph of:
$$f(...
23
votes
12
answers
2k
views
Quicksand (piles)
In this fastest-code challenge, you take a positive integer as input, which represents the height of a sand pile, located at (0,0) on an infinite square grid. For example, if our input is ...
15
votes
7
answers
669
views
Double the diagonal squares
Given a positive integer N, output this doubling pattern of slash squares/rectangles.
For N=1, the base is:
...
22
votes
9
answers
1k
views
Unicode T-square
Challenge
Create a function or program that, when given an integer size, behaves the following way:
If size is equal to 1, ...
23
votes
2
answers
2k
views
Eye test - How many squares are in this picture?
The picture:
Sick of the same old grid where the answer is simply a square pyramidal number?
Accept the challenge and write a program that given a positive integer \$n\$ counts how many squares are in ...
23
votes
15
answers
3k
views
The Cantor Function
The Cantor function is continuous everywhere and constant almost everywhere, but has an average slope of 1:
The function can be found recursively:
\$f_0(x)=x\$
\$f_{n+1}(x)=\left\{\begin{matrix}\frac{...
7
votes
1
answer
697
views
Hilbertize an image
For a computer vision app I want to do a mapping of an image, in such a way that every pixel fit hilbert curve, instead of conventional layout. So task could be as follows:
Task description
Given ...
10
votes
4
answers
1k
views
ASCII art H trees
An H tree is a fractal tree structure that starts with a line. In each iteration, T branches are added to all endpoints. In this challenge, you have to create an ASCII representation of every second H ...
16
votes
9
answers
3k
views
Drawing the Peano curve
Introduction
In geometry, the Peano curve is the first example of a space-filling curve to be discovered, by Giuseppe Peano in 1890. Peano's curve is a surjective, continuous function from the unit ...
17
votes
12
answers
715
views
Generalized Cantor set segment lengths
Problem
Let's define a generalized Cantor set by iteratively deleting some rational length segments from the middle of all intervals that haven't yet been deleted, starting from a single continuous ...
81
votes
30
answers
13k
views
Create an "H" from smaller "H"s
Challenge
Create a function or program that, when given an integer size, does the following:
If size is equal to 1, output
...