UNB/ CS/ David Bremner/ teaching/ java/ Intsect3.java
import ccj.*;

public class Intsect3 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();
      }
   }
}