In mathematics, the Lévy C curve is a self similar fractal that was first described and investigated by French mathematician Paul Lévy in his 1938 paper Plane or Space Curves and Surfaces Consisting of Parts Similar to the Whole.
L-system construction:
If using a Lindenmayer system then the construction of the C curve starts with a straight line. An isosceles triangle with angles of 45°, 90° and 45° is built using this line as its hypotenuse. The original line is then replaced by the other two sides of this triangle.
At the second stage, the two new lines each form the base for another right-angled isosceles triangle, and are replaced by the other two sides of their respective triangle. So, after two stages, the curve takes the appearance of three sides of a rectangle with the same length as the original line, but only half as wide.
At each subsequent stage, each straight line segment in the curve is replaced by the other two sides of a right-angled isosceles triangle built on it. After n stages the curve consists of 2n line segments, each of which is smaller than the original line by a factor of 2n/2.
The fractal curve that is the limit of this "infinite" process is the Lévy C curve. It takes its name from its resemblance to a highly ornamented version of the letter "C".
Variations:
The standard C curve is built using 45° isosceles triangles. Variations of the C curve can be constructed by using isosceles triangles with angles other than 45°. As long as the angle is less than 60°, the new lines introduced at each stage are each shorter than the lines that they replace, so the construction process tends towards a limit curve. Angles less than 45° produce a fractal that is less tightly "curled".
IFS construction:
If using a iterated function system (IFS, or the random game IFS-method actually), then the construction of the C curve is a bit easier. It will need two sets of "rules" and that is: Two points in a plane (the translators), each associated with a scale factor of 1 / sqrt(2). The first rule will have a rotation of 45° and the second -45°. This set will iterate a point [x, y] from randomly choosing any of the two rules and use the parameters associated with the rule to scale/rotate and translate the point using a 2D-transform function.