![]() if this circle is too close to another circle, BAIL if this circle does not fit in the rectangle, BAIL this functions attempts to build a circle If the box fills up before the desired number of circles are created, the radius is reduced and it all starts over again. If it doesn't fit, the line will swing 360 degrees, checking for open spaces. ![]() If the new circle fits, another line will be extended from the new circle. If that circle fits, it extends a diameter line from that circle and tries to create a circle at the end of the line. It then tries to fit one circle in the corner of the box. The program starts by calculating a large radius based on the box dimensions. Every circle will always be touching another circle.One circle will always be in the corner.The program is now called via the wrapped function. This is code golf, so shortest program (as of ) wins. Just to make this reasonable and do-able, all numbers must be precise to the 2nd decimal place. If any circle overlaps or does not fit entirely inside of the box, your submission is invalid. You can use command line arguments, user input, hard coded variables, or anything else you want. This program must run with any size of rectangle, and any number of circles and still get a valid answer. Lastly, it should create and save a picture with these circles drawn. (Obviously, you must replace some_number with the radius your program calculates, N with the number of circles you end up using, and x and y with the actual coordinates of the circle) Your program should then print this to the console: Highest possible radius: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |