Draw the two points of intersection in red print out the x


How to write a program that computes the intersection of a circle with a horizontal line and displays the information textually and graphically. Input: Radius of the circle and the y-intercept of the line. Prompt the user for these values.Output:

Draw a circle centered at (0,0) with the given radius in a window with coordinates running from (-10,-10) to (10,10).

Draw a horizontal line across the window with the given y-intercept.

Draw the two points of intersection in red.

Print out the x values of the points of intersection in the upper left-hand corner of the window.

Formula for the intersection values of x: plus/minus squareroot of r^2-Y^2 where r is the radius and y is the y-intercept.

When the user clicks anywhere on the window, it should close

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Draw the two points of intersection in red print out the x
Reference No:- TGS02355061

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)