Wednesday, December 11, 2024

An app that imitates growing flowers

An app that draws circles and arranges them so that the axis of each new circle is oriented 120° from the previous circle's, and so that each circle's diameter is coincident with its Fibonacci number.

Here are some starter code that will require reworking: 

<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 400 400">
  <style>
    .circle { fill: none; stroke: black; stroke-width: 2; }
  </style>

  <circle class="circle" cx="0" cy="0" r="1" />
  <circle class="circle" cx="100" cy="0" r="2" />
  <circle class="circle" cx="-50" cy="86.6" r="3" />
  <circle class="circle" cx="-100" cy="-50" r="5" />
  <circle class="circle" cx="75" cy="-130" r="8" />
  <circle class="circle" cx="175" cy="75" r="13" />
  <circle class="circle" cx="-150" cy="175" r="21" />
</svg>