Note: your program should terminate if the user enters a negative radius.
You need to consider the case where one circle is
completely contained inside the other, but the circles
do not intersect. For example, one such case to
consider is:
Note: This program checks to see if t is a substring of s. Ask the user, first for the string s and then for the string t.
The program then calls the recursive function descend which takes 3 points as parameters:
public void descend(Point p1, Point p2, Point p3)
The function descend checks if the distance between the first two points is less than 0.5. In which case, it stops. Otherwise, it draws a triangle connecting p1, p2, and p3, calculates the midpoints of the three sides of the triangle, and calls descend again with the midpoints.
The function descend calls two helper functions to calculate the midpoint of a line:
public Point midpoint(Point a, Point b)and the distance between two points:
public double distance(Point a, Point b)
Submit this as program 12 using the electronic submission. Please call the file (and the class) Program12. Also, include an html file called "Program12.html" which calls your applet. (Due 5 March)