Math Art

CS MYamanaka

Lua + Cairo scripts that generate patterns and designs

Description

This is mostly an exercise in mathematics that uses geometry and domain converions (mainly Polar to XY coordinates and vice versa) to create nice patterns that could be used as a decent minimalist desktop wallpaper.

The resulting images can be seen on my art page.

Spiral Pattern

The Lua script "spiral.lua" shows that a "line" (for the lack of a better term) in polar coordinates (i.e. a set of points [r, theta] where r changes constantly with respect to theta), when rendered on the XY-plane, appears as spiral. In this script, I generate multiple spirals sampled by points whose size and colour vary by the radius.

Rose Pattern

The script "rose.lua" generates sets of points or "petals" using trigonometry and the fibonacci sequence. Each "petal" is generated by using three periods of the absolute value of the sine function. The width and the arrangement of these "petals" are calculated using fibonacci sequence. For instance, the inner most layer correspond to the fourth fibonacci number, 2, and contains two petals and each petal has the angular width of 2Pi/(2 + 1). The next layer corresponds to the fifth fibonacci number, 3, and contains 3 petals where each has the width 2PI/(3 + 1).