Typeset Fractals

A simple example of self-similarity in a typeset expression is a continued fraction, where each “denominator” resembles the whole expression:

1/(1 + 1/(1 + 1/(1 + 1/(...))))

Using Mathematica’s programmable typesetting system, you can create expressions that look like classic fractals. For instance, the Sierpinski gasket:

Nest[SubsuperscriptBox[#,#,#]&, "\[CapitalOmega]", 5] //DisplayForm

Sierpinski carpet:

StyleBox[
 Nest[
  GridBox[{{#,#,#}, {#," ",#}, {#,#,#}}]&,
  "\[FilledSquare]", 3],
  GridBoxOptions->{
    RowMinHeight->0, RowSpacings->0, ColumnSpacings->0}] //DisplayForm

© 1998–2024 by Robert Dickau.

[ home ] || [ 2010-12-14 ]


www.robertdickau.com/typefrac.html