An archived instance of a Discrete forum

Your golden rectangle fractal

mark

(15 pts)

Your mission in this problem is to generate a golden rectangle fractal using the code in this Observable notebook. Specifically, you’ll extract a sub-graph of the digraph for the full golden rectangle / square digraph pair. Once you do so, respond here with:

  1. Javascript code defining the digraph IFS,
  2. an image of the 0^{\text{th}} attractor,
  3. and the dimension of the attractor.

To get your specific sub-graph, choose your name here:

Patt

[1] The Javascript Code

smaller_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower left rectangle in square
    source: "S",
    target: "R",
    f: scale(1 / p ** 2),
    label: "SR1"
  }
]

[2] 0th attractor:

[3] Dimension of the attractor: 0.9999999999999999

Eli
  1. Javascript code
full_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower left rectangle in square
    source: "S",
    target: "R",
    f: scale(1 / p ** 2),
    label: "SR1"
  },
  {
    // Upper left rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p ** 2])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR3"
  },
  {
    // Upper right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p]).compose(scale(1 / p ** 2)),
    label: "SR4"
  },
]

1.7333638761871373

nhowe

1] The Javascript code…

smaller_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p + 1 / p ** 2, 0])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR2"
  },
  {
    // Square in square
    source: "S",
    target: "S",
    f: shift([1 / p ** 2, 1 / p ** 2]).compose(scale(1 / p ** 3)),
    label: "SS"
  }
]

2] Image of the 0th constructor


3] The dimension is 1.1295131253903554

ksimmon1

JavaScript Code:

full_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower left rectangle in square
    source: "S",
    target: "R",
    f: scale(1 / p ** 2),
    label: "SR1"
  },
  {
    // Lower right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p + 1 / p ** 2, 0])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR2"
  },
  {
    // Upper right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p]).compose(scale(1 / p ** 2)),
    label: "SR4"
  },
]

0th attractor:

Dimension of the attractor: 1.7333638761871373

bshambli
  1. The Javascript code:
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower left rectangle in square
    source: "S",
    target: "R",
    f: scale(1 / p ** 2),
    label: "SR1"
  },
 
   {
     // Square in square
     source: "S",
     target: "S",
     f: shift([1 / p ** 2, 1 / p ** 2]).compose(scale(1 / p ** 3)),
     label: "SS"
   }
]
  1. 0th attractor:

  2. Dimension: 0.5843571576574039

athach1

1.) Javascript Code

full_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p + 1 / p ** 2, 0])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR2"
  },
  {
    // Upper left rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p ** 2])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR3"
  },
  {
    // Upper right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p]).compose(scale(1 / p ** 2)),
    label: "SR4"
  },
]

3.) Dimension = 1.7333638761871373

athach
  1. Javascript Code (defining the digraph IFS),
    full_digraph_input = [
    {
    // Rectangle in rectangle
    source: “R”,
    target: “R”,
    f: shift([p, 0])
    .compose(rotate(pi / 2))
    .compose(scale(1 / p)),
    label: “RR”
    },
    {
    // Square in rectangle - don’t delete!!
    source: “R”,
    target: “S”,
    f: scale(1),
    label: “RS”
    },
    {
    // Lower left rectangle in square
    source: “S”,
    target: “R”,
    f: scale(1 / p ** 2),
    label: “SR1”
    },

{
// Upper right rectangle in square
source: “S”,
target: “R”,
f: shift([1 / p ** 2, 1 / p]).compose(scale(1 / p ** 2)),
label: “SR4”
},
{
// Square in square
source: “S”,
target: “S”,
f: shift([1 / p ** 2, 1 / p ** 2]).compose(scale(1 / p ** 3)),
label: “SS”
}
]

  1. Image of the 0 th attractor

  2. Dimension of the attractor: 1.618033988749895

csluder2

1.smaller_digraph_input = [
{
// Rectangle in rectangle
source: “R”,
target: “R”,
f: shift([p, 0])
.compose(rotate(pi / 2))
.compose(scale(1 / p)),
label: “RR”
},
{
// Square in rectangle - don’t delete!!
source: “R”,
target: “S”,
f: scale(1),
label: “RS”
},

{
// Lower right rectangle in square
source: “S”,
target: “R”,
f: shift([1 / p + 1 / p ** 2, 0])
.compose(scale(1 / p ** 2))
.compose(rotate(pi / 2)),
label: “SR2”
},
{
// Upper left rectangle in square
source: “S”,
target: “R”,
f: shift([1 / p ** 2, 1 / p ** 2])
.compose(scale(1 / p ** 2))
.compose(rotate(pi / 2)),
label: “SR3”
},

{
// Square in square
source: “S”,
target: “S”,
f: shift([1 / p ** 2, 1 / p ** 2]).compose(scale(1 / p ** 3)),
label: “SS”
}
]

  1. The dimension is: 2.0000000000000004
Jared
full_digraph_input = [
  {
    // Rectangle in rectangle
    source: "R",
    target: "R",
    f: shift([p, 0])
      .compose(rotate(pi / 2))
      .compose(scale(1 / p)),
    label: "RR"
  },
  {
    // Square in rectangle - don't delete!!
    source: "R",
    target: "S",
    f: scale(1),
    label: "RS"
  },
  {
    // Lower left rectangle in square
    source: "S",
    target: "R",
    f: scale(1 / p ** 2),
    label: "SR1"
  },
  {
    // Upper left rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p + 1 / 1 / p ** 2, 0])
      .compose(scale(1 / p ** 2))
      .compose(rotate(pi / 2)),
    label: "SR2"
  },
  // Square in square
  {
source: "S",
target: "S",
f: shift([1 / p ** 2, 1 / p ** 2]).compose(scale(1 / p ** 3)),
label: "SS"
},
  {
    // Upper right rectangle in square
    source: "S",
    target: "R",
    f: shift([1 / p ** 2, 1 / p]).compose(scale(1 / p ** 2)),
    label: "SR4"
  },
]

  1. Dimension: 1.792463490595278
mark