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]
2 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]2 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
I need subscribers plz ​
melamori03 [73]

Answer:

No :) here this is my channel name jshdhebejdb

8 0
2 years ago
Read 2 more answers
Which technology will a business use to identify unauthorized access to intranet sites or files by its employees?
monitta

Answer:

Computer Forensics

Explanation:

Your Welcome....

8 0
2 years ago
What is an easy and accurate way that a graphic designer can increase the size of a digital shape while keeping the ratio of hei
VikaD [51]

Answer:

Open the shape’s properties window, and type the height value multiplied by 2 and the width value multiplied by 3.

Explanation:

7 0
3 years ago
Read 2 more answers
Which two graphs best represent the motion of an object falling freely?
larisa [96]
The graph would have to be pointing completely down to be falling freely.
4 0
3 years ago
What is one way you might code-switch when posting a comment to a class discussion?
irina [24]

Answer:

The term code switching has been expanded and can encapsulate in any situation that speaker find to be switch from vocabulary.

Explanation:

It is a truly remarkable skill when you communicate your emotions, thoughts and opinion to others. It does not mean that we just to communicate our language but our language influence our thought, emotions and language and self identity.

we communicate our culture that is reflected in our language. Our language tells that who we are and from where we comes.

Code switching is related to the speakers alternates use of multiple language. in the one communication.

For example: Grace for beautiful gift ( Esta awesome).

7 0
2 years ago
Other questions:
  • What program controls the hardware and software in a computer?
    10·1 answer
  • How to turn a flash drive into a bluetooth adapter?
    13·1 answer
  • Using a network without the network owner's permission is known as ________.
    10·1 answer
  • This is question 2.5 Computer Science and I don't understand what is wrong<br><br>​
    15·1 answer
  • A(n) ____ is the computer counterpart to an ordinary paper file you might keep in a file cabinet or an accounting ledger.a. data
    6·1 answer
  • Create a loop that will output all the multiples of 5 that are greater than zero and less than 60 (do not include 60). 5, 10, 15
    10·1 answer
  • Which skill type refers to the knowledge and ability to perform a task?
    13·2 answers
  • Follow me on Tik-Tok​
    7·2 answers
  • Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and asso
    12·1 answer
  • Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!