YellowSpace.java
1    package shapes;
2    
3    
4    public class YellowSpace {
5        public static void main(String[] args) {
6            double lgs = 400;
7            double lyd = 60;
8            double sgs = 30;
9            double syd = 15;
10   
11           //large gray square
12           SSquare lgsf =  new SSquare(lgs);
13           //largeyellowdiamond
14           double diagonal = lgs - (lyd*2);
15           SSquare lydf = new SSquare(diagonal* Math.sqrt(2)/2);
16           //small grey square
17           SCircle ilyd = lydf.inscribingCircle();
18           double diagonal2 = ilyd.diameter() - (sgs*2);
19           SSquare sgsf = new SSquare(diagonal2*Math.sqrt(2)/2);
20           //Small yellow diamond
21           SCircle isgs = sgsf.inscribingCircle();
22           double diagonal3 = isgs.diameter() - (syd*2);
23           SSquare sydf = new SSquare(diagonal3*Math.sqrt(2)/2);
24   
25           double YellowSpace = lydf.area() - sgsf.area() + sydf.area();
26           System.out.println("The area of the yellow space is: " + YellowSpace );
27       }
28   }
29