Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compute the intersection between a line and circle ADTs Create a Circle ADT with fields for the center and radius of the circle Create a

Compute the intersection between a line and circle

ADTs

Create a Circle ADT with fields for the center and radius of the circle

Create a Line ADT with fields for the slope and y-intercept of the line

Functions

getCircle: Asks the user to enter the center and radius of a circle. Returns a Circle ADT.

getLine: Asks the use to enter the slope and y-intercept of a line. Returns a Line ADT.

check: A void function that takes as input a Circle and Line ADT. Prints out the intersection of the line and circle. If no intersection exist pints out "no intersections"

Main

Calls the functions getCirlce, getLine, and check.

Here are three sample input and output sets to test your code

Enter the center point and radius: 1 2 5

Enter the line slope and yint: 2 -1

The Intersection is (-0.827106, -2.65421) and (3.62711, 6.25421)

Enter the center point and radius: 1 2 5

Enter the line slope and yint: -2 -10

There is no intersection.

Enter the center point and radius: 1 2 5

Enter the line slope and yint: 1 5.9054

The Intersection is (-3.99912, 1.90628) and (1.09372, 6.99912)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago