Skip to main content

Circle divided in 8 equal part,each part is 45 degree in JAVA Applet.

CODING:
 /*<applet code="cor" width=455 height=455>
<param name="radius" value="335">
</applet>*/
import java.applet.*;
import java.awt.*;
public class cor extends Applet
 {
       public void paint(Graphics g)
         {
           int R=Integer.parseInt(getParameter("radius"));
           int x,d=R*2;
           double i=R+1;
           g.drawOval(0,0,d,d);
           g.drawLine(R,0,R,d);
           g.drawLine(0,R,d,R);
           for(x=R;i>=R;x--)
            {   
i=Math.sqrt(x*x*2);
             }
                g.drawLine(R-x,R-x,d-(R-x),d-(R-x));
                g.drawLine(d-(R-x),R-x,R-x,d-(R-x));
           }
 }

Comments