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
Programmers can use sql on systems ranging from pcs to mid-size servers.
zaharov [31]

It is false that Programmers can use SQL on systems ranging from PCs to mid-size servers.

Applications for structured query language can be found in a wide range of sectors, mostly in those that deal with database-related tasks. It might be used, for example, by a data analyst to query data sets and produce precise insights. On the other hand, a data scientist might use this programming language to add data to their models.

Businesses and other organizations use SQL tools to create and modify new tables as well as access and edit information and data in their databases.

A database is a tool for gathering and organizing data. Databases can store data about people, things, orders, and other things. Many databases begin in a spreadsheet or word processor. Many firms find it beneficial to move them to a database made by a database management system as they grow larger.

SQL helps manage the data kept in databases, enabling users to get the precise data they require when they need it.

To learn more about SQL click here:

brainly.com/question/13154090

#SPJ4

4 0
1 year ago
Pre-Test
ozzi

Some of the options in this question are not correct; here is the correct and complete question:

In order for a fictionalized story to be based on real events, the author should include

A. Characters with strong feelings

B. Historical material

C. A narrator

D. Dialogue​

The correct answer is B. Historical material

Explanation:

Stories, novels, and poems are said to be based on real events if these include or are inspired by real people, settings, or historical events. This includes using any historical material and adapting it to create a story. For example, the play "The Tragedy of Julius Caesar" written by Shakespeare is a play based on real events as it includes real characters such as Julius Caesar and some of the events in it are based on historical events.

According to this, the element that is necessary to make a story to be based on real events is historical material. Also, others such as a narrator, dialogue, or characters with strong feelings can be found in most stories including those that are completely fictionalized.

3 0
3 years ago
What are the steps to configure user information in a document?
chubhunter [2.5K]

Answer:

file, properties, options, general

Explanation:

4 0
3 years ago
Read 2 more answers
Please someone helppppppp
Cerrena [4.2K]

Answer : communicate is the answer.

5 0
3 years ago
Read 2 more answers
How do you comment on someone's answer on Brainly???
Semenov [28]
Press ANSWER , and reply
5 0
3 years ago
Other questions:
  • Your computer is crashing on a regular basis. Which of the following is an operation available to the user that should help rese
    6·2 answers
  • Computer maker Dell realized the problems with keeping large inventories, especially because of the fast rate of obsolescence of
    7·1 answer
  • To use the program service routines, the user's program makes requests to the operating system through the
    10·1 answer
  • Eric would like to have a color textbook that makes it look as if the character in an image is speaking. Which object should he
    14·1 answer
  • # q7 - create function readFileFirstLast() to meet the conditions below
    10·1 answer
  • Compare entertainment applications to social media applications.
    5·2 answers
  • Which hardware device connects your network to the internet? select one:
    15·1 answer
  • In C++ please.
    8·1 answer
  • Jack used primarily web sources for his informative speech about gun control. however, his over-reliance on the web site sponsor
    11·1 answer
  • Record the issue of 4,000 shares of $5 par value common stock for $35000 cash
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!