Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- class D{
- public static void main(String[]v){
- new Frame(){
- int i,r=Short.valueOf(v[0]),s=Short.valueOf(v[1]),o=r+30,x[]=new int[s],y[]=x.clone();
- public void paint(Graphics g){
- for(i=0;i<s;setSize(o*2,o*2)){
- x[i]=(int)(Math.cos(6.28*i/s)*r+o);
- y[i]=(int)(Math.sin(6.28*i++/s)*r+o);
- }
- g.drawPolygon(x,y,s);
- }
- }.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement