import javax.swing.JFrame;
public class MyDrawArc {
public static void main(String args[]) {
// pnarc(40);
// bresenham_arc(40);
dissert_arc(30, 40);
}
private static void dissert_arc(int a, int b) {
JFrame frame = new JFrame();
TwoDimen env = new TwoDimen();
frame.getContentPane().add(env);
frame.setBounds(100, 100, 600, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setVisible(true);
int x, y;
double d;
x = 0;
y = b;
d = b * b + a * a * (- b + 0.25);
while (b * b * (x + 1) < a * a * (y - 0.5)) {
env.drawPoint(x, y);
env.drawPoint(x, -y);
env.drawPoint(-x, y);
env.drawPoint(-x, -y);
if (d < 0) {
d = d + b * b * (2 * x + 3);
} els