Automated Generation of Two- and Three-Dimensional Fractal...

20
Automated Generation of Two- and Three-Dimensional Fractal Tilings Jonathan Hafner Department of Theoretical and Applied Mathematics The University of Akron Email: [email protected] Advisor: Dr. Thomas E. Price

Transcript of Automated Generation of Two- and Three-Dimensional Fractal...

Page 1: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Automated Generation of Two-and Three-Dimensional Fractal

Tilings

Jonathan HafnerDepartment of Theoretical and

Applied MathematicsThe University of Akron

Email: [email protected]: Dr. Thomas E. Price

Page 2: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Objectives:

• Explain fractal generation method• Introduce residue vector determination

algorithm• Extend to three dimensions

Page 3: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Generating a two-dimensional tiling:

1. Choose an appropriate 2×2 integer matrix– Absolute value of determinant greater than 1– Expansive map (each eigenvalue has modulus

greater than 1)2. Determine principal residue vectors

– Plot parallelogram determined by column vectors

– Find integer vectors "inside" parallelogram

Page 4: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

−1221

Page 5: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

3. Choose a point x on the plane. Let M be our integer matrix, m = det(M), and rn be the nth residue vector. (Note that n ∈ {0, 1, 2, ... , |m| - 1 }.) Iterate on the function system fn(x) = M-1x + rn by randomly choosing a function for each iteration. Plot these points, associating each fn with a color.

Page 6: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

−1221

Page 7: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

=

−−

=

=

01

21

11

21

111

2221

1211

21

111

1121

1222

aa

aa

aaaa

aa

M

ma

ma

ma

ma

In searching for a better algorithm for residue vector determination, first observe that M-1 maps our parallelogram onto the unit square. For example,

The other corners of the parallelogram map to the other corners of the unit square in a similar fashion.

Page 8: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Consider some integer vector (s, t) inside our parallelogram (i.e., a principal residue vector). Then

Note that this can be rewritten in the form (i/m, j/m), for some i, j ∈ {0, 1, 2, ... , |m| - 1 }.

=

=

msata

mtasa

ts

aaaa

ts

M

2111

1222

1

2221

12111

Page 9: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

To illustrate:

1−M

M

−=

1221

M

Page 10: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

To find our residue vectors, then, we simply reverse the process: Let b = (i/m, j/m), for some i, j ∈ {0, 1, 2, ... , |m| - 1 }. Then

If each of these entries is an integer, then Mb is a principal residue vector.

=

=

+

+

mjaia

mjaia

mj

mi

aaaa

M

2221

1211

2221

1211b

Page 11: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

This leads us to the following algorithm, presented here in C++:

int n = 0;for (int i = 0; i < Det; i++)for (int j = 0; j < Det; j++){

if ( ( (a11*i + a12*j) % Det == 0 ) &&( (a21*i + a22*j) % Det == 0 ) )

{res[n].x = (a11*i + a12*j) / Det;res[n].y = (a21*i + a22*j) / Det;n++;

}}

(Here, Det = |m|, and res[] is the array of residue vectors.)

Page 12: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Sample application of this algorithm:

−=

8558

M

Page 13: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Extension to Three Dimensions

Nearly everything here applies to three dimensions as well, with the following modifications:

• 3×3 integer matrices are used, whose columns determine a parallelepiped

• all vectors have three components• the inverse matrix maps the parallelepiped

onto the unit cube

Page 14: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

=

=

001

31

21

111

333231

232221

131211

31

21

111

aaa

aaaaaaaaa

aaa

M

In rough parallel to our discussion of the two-dimensional case, first consider the first column of M, which is mapped to one corner of the unit cube by M-1:

The other corners of the parallelepiped map to the other cornersof the unit cube in a similar fashion.

Page 15: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

It can be shown (with a fair amount of tedious computation) thateach residue vector is mapped by M-1 to a vector of the form (i/m, j/m, k/m) for some i, j, k ∈ {0, 1, 2, ... , |m| - 1 }. Hence, to find our residue vectors, we again reverse the process, letting b = (i/m, j/m, k/m), for some arbitrary i, j, k. Then

As before, if each of these entries is an integer, then Mb is a principal residue vector. This allows us to extend our algorithm to the three-dimensional setting, where it is much more useful.

=

=

++

++

++

mkajaia

mkajaia

mkajaia

mkmj

mi

aaaaaaaaa

M

333231

232221

131211

333231

232221

131211

b

Page 16: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

int n = 0;for (int i = 0; i < Det; i++)

for (int j = 0; j < Det; j++)for (int k = 0; k < Det; k++){

if ( ( (a11*i + a12*j + a13*k) % Det == 0 ) &&( (a21*i + a22*j + a23*k) % Det == 0 ) &&( (a31*i + a32*j + a33*k) % Det == 0 ) )

{res[n].x = (a11*i + a12*j + a13*k) / Det;res[n].y = (a21*i + a22*j + a23*k) / Det;res[n].z = (a31*i + a23*j + a33*k) / Det;n++;

}}

Page 17: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

−120210

212

Page 18: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

View from the positive xdirection of

−120210

212

Page 19: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Future Projects

• Improve interface and functionality of generator programs

• Explore properties of three-dimensional fractal tilings

Page 20: Automated Generation of Two- and Three-Dimensional Fractal ...math.uakron.edu/~tprice/student/jon.pdf · Advisor: Dr. Thomas E. Price. Objectives: • Explain fractal generation method

Automated Generation of Two-and Three-Dimensional Fractal

Tilings

Jonathan HafnerDepartment of Theoretical and

Applied MathematicsThe University of Akron

Email: [email protected]: Dr. Thomas E. Price