Difference between revisions of "For Tutorial 5"

From Progzoo
Jump to: navigation, search
(Octagons)
(Octagons)
Line 57: Line 57:
 
   }
 
   }
 
   g.setColor(Color.black);
 
   g.setColor(Color.black);
   g.translate(75,5);
+
   g.translate(75,75);
 
   g.translate(-r,-r);
 
   g.translate(-r,-r);
 
   g.fillPolygon(reg);
 
   g.fillPolygon(reg);

Revision as of 13:46, 8 October 2012

Regular Polygon

You can find the coordinates of a regular polygon using sin and cosine.

Change n and r so that you get a hexagon that is twice the size.

Flaghexagon.png


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

Octagons

Draw the octogon 5 times to make the figure shown.

Flagoctagons.png


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