2
$\begingroup$

This question is from Section 29 of "An Elementary Introduction to the Wolfram Language".

The objective is to successively add regular polygons with between 3 and 8 sides, and with opacity 0.2, using the commands FoldList and ImageAdd and using pure functions.

My attempts (multiple attempts, none working out) went something like this:

FoldList[ImageAdd, {Graphics[Opacity[0.2],{RegularPolygon[#]}]}&/@{3,4,5,6,7,8}

Or

FoldList[ImageAdd[#1,#2]&,#1&, Graphics[{Opacity[0.2],RegularPolygon[]}]

Both are unfinished code as I didn't know how to execute this properly, but I wanted to show the general idea I was attempting.

Any help would be greatly appreciated!

$\endgroup$
3
  • 3
    $\begingroup$ FoldList[ImageAdd, Graphics[{Opacity[0.2], RegularPolygon[#]}] & /@ {3, 4, 5, 6, 7, 8}] $\endgroup$
    – cvgmt
    Jun 14, 2023 at 11:58
  • $\begingroup$ Perfect, thank you! $\endgroup$
    – am567
    Jun 14, 2023 at 12:01
  • 5
    $\begingroup$ https://www.wolfram.com/language/elementary-introduction/3rd-ed/answers-to-exercises.html $\endgroup$
    – Syed
    Jun 14, 2023 at 13:30

0