1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zepler [3.9K]
3 years ago
12

Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or inters

ect. 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.
​
Computers and Technology
1 answer:
beks73 [17]3 years ago
6 0

Answer:

The method is as follows:

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

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

    else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

    else{

        System.out.print("The circles intersect");     }

}

Explanation:

This defines the method

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

This calculate the distance

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

If the distance equals the sum of both radii, then the circles touch one another

<em>     if(d == r1 + r2){</em>

<em>         System.out.print("The circles touch each other");     }</em>

If the distance is greater than the sum of both radii, then the circles do not touch one another

<em>    else if(d > r1 + r2){</em>

<em>         System.out.print("The circles do not touch each other");     }</em>

If the distance is less than the sum of both radii, then the circles intersect

<em>    else{</em>

<em>         System.out.print("The circles intersect");     }</em>

}

You might be interested in
Write. true or false​
ella [17]
Um I need a image or smth
8 0
3 years ago
Read 2 more answers
What technology would you like to use or see developed that would help you be a "citizen of the world"?
Aneli [31]

Answer and explanation:

While traveling abroad the main barrier to be considered is language. Entrepreneurs should focus special attention on developing mobile apps that interpret people's segments accurately so regardless of the country and language they can communicate through the app and make them feel they are "<em>citizens of the world</em>".

3 0
4 years ago
What is the name of the top-level parentless folder in a digital file system?
Viefleur [7K]

Answer:

ROOT

Explanation:

6 0
3 years ago
How to add a bill using the reciept capture?
HACTEHA [7]

Answer: add up all the numbers and then add the tax and then 30% of the total for the tax

Explanation:

like 3+6+8+10=26

26 30%=whatever that is and then add it all up againg and thta is your answer.

5 0
3 years ago
If your computer is running slowly, which of the following is most likely to solve the problem?
Rom4ik [11]
Rebooting the computer and calling the computer maunfactoring company will help. If not, you could go to a repair shop.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Two of the child elements of the page body are a navigation list with the ID #hole_list and an article element containing inform
    7·1 answer
  • What can emulate a fully configured PC or server?
    15·1 answer
  • What is the value of this expression?
    6·1 answer
  • A look to different section of the same page is known as_____.
    7·1 answer
  • A computer essentially takes input, processes it, and produces output. Which person developed a machine in the mid-1880s that ac
    6·1 answer
  • What strategies do you use to better understand difficult reading material? Check all that apply.
    5·1 answer
  • IfL = 4.4H and the inductive reactance of an inductor is 620 Omega find the frequency of the alternating current​
    5·1 answer
  • Will creates an entry in his calendar and marks it as an all-day instance. Which item has he created?
    10·1 answer
  • Please help! Python programming, use the factorial operation to evaluate 4!. Answers are in picture please pick one, thank you.
    15·1 answer
  • What do the last two steps in the cyclical design process most likely involve
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!