subject

Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or intersect. The method accepts the coordinates of the center of the first circle and its radius, and the coordinates of the center of the second circle and its radius. The header of the method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2)

Hint:

Distance between centers C1 and C2 is calculated as follows:
d = Math. sqrt((x1 - x2)2 + (y1 - y2)2).

There are three conditions that arise:

1. If d == r1 + r2
Circles touch each other.
2. If d > r1 + r2
Circles do not touch each other.
3. If d < r1 + r2
Circles intersect.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, ed72018373
Which law requires employers to provide safe working environments for their employees? a. civil rights act b. fair labor standards act c. occupational safety and health act d. wagner act
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, SundaeSunday
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given. b)the definition of max_balance should be removed since header files should not contain constants. c)the definition of cashregister should be removed since header files should not contain class definitions. d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
image
Computers and Technology, 23.06.2019 00:20, kathlynskare06
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
image
Computers and Technology, 24.06.2019 00:30, bsonicx
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
You know the right answer?
Write a method that prints on the screen a message stating whether 2 circles touch each other, do no...

Questions in other subjects:

Konu
Mathematics, 31.03.2021 21:40
Konu
Chemistry, 31.03.2021 21:40