// Lines0.java: Draw lines in a circle
import java.applet.Applet;
import java.awt.*;import java.awt.event.*;
public class Lines0 extends Applet{
private double xc = 200, yc = 200; // center of circle
private double x1, y1, x2, y2; // new coordinates
private double r = 150; // radius of circle
private int m = 47; // num of points around circle
private int n = 17; // num of points to skip
private double alf = 2.0*Math.PI/m; // angle around circle
private double ang1, ang2;
public void paint (Graphics g) {
for (int j = 0; j < m; j++) {
ang1 = j*alf;
ang2 = (n+j)*alf;
x1 = r*Math.cos(ang1) + xc;
y1 = r*Math.sin(ang1) + xc;
x2 = r*Math.cos(ang2) + xc;
y2 = r*Math.sin(ang2) + xc;
g.drawLine((int)x1, (int)y1, (int)x2, (int)y2);
}
}
}