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
When preparing images to be used for different mediums print web and video in photoshop different file formats are required , se
Anika [276]
The answers are :
JPEG - Compresses well without losing quality, it should be used for the web
TIFF - Can be saved in an uncompressed file format with a high resolution, it is a common file format used for professional print services
BMP - Can be saved in a compressed or uncompressed file format, It is a common file format used for either web or print
<span>FLV or SWF - Used to publish a rendered video for use on the web</span>
5 0
3 years ago
Fill in the blank to complete the sentence. -------------------- is used to store and process data over the Internet using compu
Trava [24]

Answer:cloud computing

Explanation:

6 0
2 years ago
Which form of media allows the audience to share in and comment on the content immediatly
Luba_88 [7]

twitter

they will allow you to share comments about any topic you want

4 0
3 years ago
CALL NOW $+1-855-241-6569$ aol mail not working on windows ## aol desktop gold email not working||USA||**2020*
LenKa [72]

Answer:

extra 5 points lol

Explanation:

6 0
3 years ago
In g.o.o.g.l.e sheet Columns are labeled by ____​
telo118 [61]

Answer:

Explanation:

Click the Data option.

Click on Named Range. This will open the 'Named ranges' pane on the right.

Click on the 'Add a range' option.

Enter the name you want to give the column (“Sales” in this example)

Make sure the column range is correct. ...

Click on Done.

3 0
2 years ago
Other questions:
  • In c++
    9·1 answer
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • PLEASE HELP!
    12·2 answers
  • What is used to monitor the activity of a network and notify network administrators when it identifies something as suspicious?
    15·1 answer
  • When a formula contains the address of a cell, it is called a(n) ________.
    15·1 answer
  • A blank operates as a standalone device and is shared by multiple users
    12·2 answers
  • Cloud computing allows organizations to rent computing resources from providers instead of having their own locally managed ____
    7·1 answer
  • Describe how you would create a Java program that prompted the user to correctly enter a username and password. The username is
    7·1 answer
  • How do you change the order of the slides in your presentation in the slide pane 
    15·2 answers
  • What dog breed is this
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!