/home/akc/NetBeansProjects/CS1/src/shapes/RedArea.java
 1 /*
 2  * This program affords opportunities to explore the computational solution to
 3  * simple geometrical problems by means of the construction and use of basic
 4  * shapes.
 5  */
 6 package shapes;
 7 
 8 /**
 9  *
10  * @author akc
11  */
12 public class RedArea {
13 
14     /**
15      * @param args the command line arguments
16      */
17     public static void main(String[] args) {
18         // VALUES GIVEN
19         double edgelength = 40;
20         double distance = 3;
21         
22         // CIRCLE FOR BIG RED SQUARE - TO FIND MIDPOINT
23         SSquare table = new SSquare(edgelength);
24         SCircle bigcircle = (table.circumscribingCircle());
25         double tablemiddle = bigcircle.radius();
26         double bigred = table.area();
27         
28         // CIRCLE FOR BLUE SQUARE - TO FIND AREA OF BLUE SQUARE
29         SCircle bluecircle = new SCircle (tablemiddle-distance);
30         SSquare bluesquare = bluecircle.inscribingSquare();
31         double bluearea = bluesquare.area();
32         
33         // CIRCLE FOR SMALL RED SQUARE
34         SCircle smallcircle = new SCircle (bluecircle.radius()-distance);
35         SSquare interiorredsquare = smallcircle.inscribingSquare();
36         double smallred = interiorredsquare.area();
37         
38         // SOLVE FOR RED AREA
39         double redarea = ((bigred - bluearea) + smallred);
40         
41         // PRINT SOLUTION
42         System.out.println("The red area of the table is " + redarea);
43     }
44     
45 }
46