Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.awt.*;
  2. class D{
  3. public static void main(String[]v){
  4. new Frame(){
  5. int i,r=Short.valueOf(v[0]),s=Short.valueOf(v[1]),o=r+30,x[]=new int[s],y[]=x.clone();
  6. public void paint(Graphics g){
  7. for(i=0;i<s;setSize(o*2,o*2)){
  8. x[i]=(int)(Math.cos(6.28*i/s)*r+o);
  9. y[i]=(int)(Math.sin(6.28*i++/s)*r+o);
  10. }
  11. g.drawPolygon(x,y,s);
  12. }
  13. }.show();
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement