import ccj.*; public class Intsect4 extends GraphicsApplet { public void run() { double radius = readDouble("Radius: "); Circle c = new Circle(new Point(0, 0), radius); double b = readDouble("Line position: "); Line s = new Line(new Point(-10, b), new Point(10, b)); c.draw(); s.draw(); double r = radius * radius - b * b; if (r >= 0) { double root = Math.sqrt(r); Point p1 = new Point(root, b); Point p2 = new Point(-root, b); p1.draw(); p2.draw(); } else { Message m = new Message(new Point(0, 0), "No intersection"); m.draw(); } } }