1 package shapes; 2 3 public class YellowSpace { 4 public static void main(String[] args) { 5 6 //big gray square, which we do not necessarily need because we want to know the yellow space 7 //SSquare bigGraySquare = new SSquare (400.0); 8 9 //big yellow diamond, which is a inscribing square of an imaginary circle which has an diameter of 400-(60+60) 10 SCircle circumscribingBigYellowDiamond = new SCircle ((400.0-(60.0*2.0))/2.0); 11 SSquare bigYellowDiamond = circumscribingBigYellowDiamond.inscribingSquare(); 12 13 //small gray square, which is an inscribing square of an imaginary circle which has a diameter of 14 // sideOfBigYellowDiamond-(30+30) 15 double sideOfBigYellowDiamond = bigYellowDiamond.side(); 16 SCircle circumscribingSmallGraySquare = new SCircle ((sideOfBigYellowDiamond-(30.0*2.0))/2.0); 17 SSquare smallGraySquare = circumscribingSmallGraySquare.inscribingSquare(); 18 19 //small yellow diamond, which is an inscribing square of an imaginary circle which has a diameter of 20 //sideOfSmallGraySquare-(15+15) 21 double sideOfSmallGraySquare = smallGraySquare.side(); 22 SCircle circumscribingSmallYellowDiamond = new SCircle ((sideOfSmallGraySquare-(15.0*2))/2.0); 23 SSquare smallYellowDiamond = circumscribingSmallYellowDiamond.inscribingSquare(); 24 25 //yellow area 26 double yellowArea = ((bigYellowDiamond.area()-smallGraySquare.area())+smallYellowDiamond.area()); 27 28 System.out.println("The area of the yellow space is " + yellowArea +" square mm."); 29 30 31 32 33 34 } 35 } 36