• BU Home | 
  • News | 
  • Events | 
  •  | 
  •  

Faculty Papers and Projects

Persian Rugs

This java applet implements a form of the algorithm presented in "Persian" Recursion by Anne M. Burns, in the June 1997 issue of Mathematics Magazine (vol. 70, No. 3), published by the Mathematical Association of America. The applet was created by Dr. Eric Gossett at Bethel University in St. Paul, Minnesota.

The image is created by coloring the outer border with an initial color (represented by an integer in the range 0 to 15). The program then chooses a new color by using a color function on the color values of the four corners (initially all the same). The new color is then used to paint the lines that form the horizontal and vertical centers of the image. The image has thus been partitioned into four subsquares. The program then recursively colors the subsquares using the same procedure.

The color function is

new color = ((top left + top right + bottom left + bottom right)/ 4 + shift) mod 16

A java applet that draws Persian rug patterns.