Friday, April 29, 2022

[csejbtmw] nested squares scaled by sqrt(0.5)

nested squares

squares alternate colors.  each square has area half its enclosing square.  linear dimensions shrink by irrational sqrt(2), so edges cannot all be on pixel boundaries.  image generated at 32768x32768, then antialiased by reducing by linear factor of 8 (and then reduced by another factor of 8 with HTML).  it compresses well with PNG using pngcrush.

it looks like looking down a striped hallway.

here are the middle 32x32 pixels, magnified:

middle pixels, antialiased

below, the squares are the same size as above, but alternate squares are rotated 45 degrees.  diamonds fit perfectly inside squares: this is why the reduction factor of sqrt(2) is special.  this time, we do SVG, terminating after 14 nestings.  (SVG plus JavaScript in principle could do fractals, not explored here.)  unlike above, vertex coordinates are always rational numbers.

diamond in square

previously, spheres shrinking by cbrt(2).

No comments :