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

public class Intsect2 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 root = Math.sqrt(radius * radius - b * b);
      Point p1 = new Point(root, b);
      Point p2 = new Point(-root, b);
      Message m1 = new Message(p1, "" + p1.getX());
      Message m2 = new Message(p2, "" + p2.getX());
      p1.draw();
      p2.draw();
      m1.draw();
      m2.draw();
   }
}