The versatility of creative coding allows programmers to produce expressive works of digital art. Using concepts derived from Processing, the Javascript library p5.js is a popular framework for coding visualizations, and is accessible to beginner and experience coders alike. A common algorithmic pattern artists create when learning code is fractal art.

Recursive functions are used to make fractals, but another fundamental programming technique for implementing recursion is transformation, which refers to the use of any of the following three functions: translate, rotate, and scale. These functions manipulate the coordinate grid in specific ways, allowing artists to expand their fractal drawings by directing their position and dictating where lines will be drawn on the coordinate space. Though the concept might seem straightforward, there are a few things to keep in mind when writing the code so that the fractal is generated successfully.

Dan Shiffman is an Associate Arts Professor of NYU’s Interactive Telecommunications Program and co-founder of the Processing Foundation. Watch the video below to see Shiffman’s demonstration of a tree fractal sketch using recursive and transformation functions.


Interested in more in-depth coding tutorials? Check out The Nature of Code:

The Nature of Code

The Nature of Code

Processing Foundation

LEARN MORE