1 /* 2 * this program will find the area of the yellow space of the diamond 3 */ 4 5 package shapes; 6 7 public class YellowSpace { 8 public static void main(String[]args){ 9 double edgelenthgray1=400; 10 double distanceToBigDiamond=60; 11 double smallGreyDistance=30; 12 double smallDiamondDistance=15; 13 14 double radius1= ((edgelenthgray1/2)-distanceToBigDiamond); 15 SCircle circle= new SCircle(radius1); 16 SSquare bigdiamond= circle.inscribingSquare(); 17 bigdiamond.area(); 18 //System.out.println(bigdiamond); 19 20 double radius2= ((bigdiamond.side()/2)-smallGreyDistance); 21 SCircle circle2= new SCircle(radius2); 22 SSquare smallgrey= circle2.inscribingSquare(); 23 smallgrey.area(); 24 //System.out.println(smallgrey); 25 26 double radius3= ((smallgrey.side()/2)-smallDiamondDistance); 27 SCircle circle3= new SCircle(radius3); 28 SSquare smallDiamond= circle3.inscribingSquare(); 29 smallDiamond.area(); 30 //System.out.println(smalldiamond); 31 32 //now we need to do some calculations to find the exact area of the yellow space 33 34 //double areabigyellow= bigdiamond-smallgrey; 35 double areaOfBigDiamond= bigdiamond.area()-smallgrey.area(); 36 37 //System.out.println(areaOfBigDiamond); 38 39 double totalAreaOfYellowSpace= areaOfBigDiamond+smallDiamond.area(); 40 System.out.println("Total area of yellow space="+totalAreaOfYellowSpace); 41 42 43 } 44 } 45