✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The combination of art and mathematics has a long history stretching back to the Ancient Greeks. The introduction of the computer obviously opened up many new avenues, and was used for creating art since the 1950s.
Nowadays, *Computer art* is a substantial field. Here are a few examples:
https://joshuadavis.com/
http://www.verostko.com/
http://www.museumofcomputerart.org/
http://aaronshome.com/aaron/index.html Probably the best-known "computer" artist.
Write a program randomtiling.py that fills a rectangular area with randomly-placed, non-overlapping circles. The circles will start large and will grow smaller and smaller. The program must accept two command-line arguments: c is a real number that controls how quickly the circles grow smaller, and N is an integer that specifies the number of circles to draw.
The program must record all the circles (their center point and radius) that it draws, so that it can check if a circle overlaps with an already drawn circle. (Store them in three arrays for the x-coordinate, y-coordinate, and radius.) Write a method intersect(x, y, r) to calculate if a new circle at (x, y) with radius r overlaps any previous circle. If it does, the method should return True, and False otherwise. Here is a major hint of how to implement this routine. Think about the relationship between d and r and r1 as the circles get closer and closer, eventually overlapping.
The following was produced with c = 0.5 and N = 100.
Below is the pseudo-code (= "code outline") to draw the circles.
Define a constant MAX_TRIES (about 50) that limits the numbers of attempts to place a new circle. If we cannot place a circle after MAX_TRIES tries, we move on to the next, smaller circle. Also, define contstants WIDTH and HEIGHT to be 500 to be the size of the canvas and scale x and y accordingly.
As this code mentions, the initial area is calculated using a formula related to the Riemann zero function. For more information on the Rieman zeta function see page 218 of the textbook or this Wikipedia article. This is an extremely important function in Mathematics, and it tends to pop up in a lot of places. Here is the code for the calculation of the area of the initial circle, given the total area of the square (area).
By playing around with the colour of new objects, you should be able to produce pictures like the following:
You may also want to change your program to draw squares instead of circles:
Or decorate the circles in another way: