Difference between revisions of "Assessment 2010 Easy"

From Progzoo
Jump to: navigation, search
(Adygea)
(Adygea)
Line 35: Line 35:
 
*9 stars on the circumference of a circle centre (125,105) radius 90
 
*9 stars on the circumference of a circle centre (125,105) radius 90
 
*The 9 stars are take from a circle of 20 equally spaced stars
 
*The 9 stars are take from a circle of 20 equally spaced stars
 +
*The arrows are at an angle of 40 degrees.
 
<prog><![CDATA[
 
<prog><![CDATA[
 
static void drawFlag(Graphics2D g){
 
static void drawFlag(Graphics2D g){
Line 46: Line 47:
 
     drawStar(g,125+r*Math.cos(a),105-r*Math.sin(a),8.0);
 
     drawStar(g,125+r*Math.cos(a),105-r*Math.sin(a),8.0);
 
   }
 
   }
 +
  double gap = r*Math.sin(2*Math.PI/n);
 +
  drawStar(g,125,105-90+gap,8.0);
 +
  drawStar(g,125+gap,105-90+gap,8.0);
 +
  drawStar(g,125-gap,105-90+gap,8.0);
 +
  drawArrow(g,125,84,0.0);
 +
  double ang = 2*Math.PI/9;
 +
  drawArrow(g,125,84,-ang);
 +
  drawArrow(g,125,84, ang);
 
}
 
}
 
static Polygon star = new Polygon(
 
static Polygon star = new Polygon(
Line 57: Line 66:
 
   g.scale(100.0/r,100.0/r);
 
   g.scale(100.0/r,100.0/r);
 
   g.translate(-x,-y);
 
   g.translate(-x,-y);
}]]></prog>
+
}
 +
 
 +
static void drawArrow(Graphics2D g,int x, int y,double a){
 +
  g.translate(x,y);
 +
  g.rotate(a);
 +
  g.drawLine(0,-19,0,30);
 +
  Polygon head = new Polygon(new int[]{0, 4,-4},new int[]{-30,-18,-18},3);
 +
  g.fillPolygon(head);
 +
  int t = 20;
 +
  Polygon tail = new Polygon(
 +
new int[]{0,  4,  4, 0,-4,-4},
 +
new int[]{t,t+4,30+4,30,30+4,t+4},6);
 +
  g.fillPolygon(tail);
 +
  g.rotate(-a);
 +
  g.translate(-x,-y);
 +
}
 +
]]></prog>
 
</question>
 
</question>

Revision as of 16:49, 19 September 2010

Flags of regions of Russia

Adygea

Flag of Adygea
  • The flag is 250 by 125
  • The green is 41,107,14
  • The yellow is 255,214,0
  • Radius of each star is 8
  • 9 stars on the circumference of a circle centre (125,105) radius 90
  • The 9 stars are take from a circle of 20 equally spaced stars
  • The arrows are at an angle of 40 degrees.


[Font] [Default] [Show] [Resize] [History] [Profile]