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
You were discussing software piracy with a friend and were surprised to learn how software piracy can impact your life every day
Vika [28.1K]
Those who use pirate software:
<span>1)Increase the chances that the software will not function correctly or will fail completely
2)Forfeit access to customer support, upgrades, technical documentation, training, and bug fixes
3)Have no warranty to protect themselves
4)Increase their risk of exposure to a debilitating virus that can destroy valuable data
5)May find that the software is actually an outdated version, a beta (test) version, or a nonfunctioning copy
6)Are subject to significant fines for copyright infringement</span>
5 0
3 years ago
1. You have been contracted to design a system for a smart car. The company installed four laser radars on the car’s corners to
Alexxandr [17]

Answer:

A). Using a flowchart, show the algorithm for the car collision avoidance system.

Explanation:

5 0
2 years ago
Carmen wanted to clear up space on her computer and remove unwanted files. What would be the best for her to delete?
melisa1 [442]

Answer:

junk files

Explanation: if a file is in a junk file it is most likely unwanted

7 0
3 years ago
Read 2 more answers
OPERATION SHEET 6.2.2 Given the Neccesary tools materials and equipment identify the common faults and errors of computer when y
worty [1.4K]

Answer: NO MORE TYPING! NO MORE CLICKING! NO MORE MEMORY! NO MORE OPERATING!

8 0
3 years ago
Why transport layer is usingconnectionless services if network layer is providing connection oriented services?
Sonbull [250]

Answer:

Transmission Control Protocol

Explanation:

Transmission Control Protocol is using connectionless services if network layer is providing connection oriented services.

8 0
3 years ago
Other questions:
  • Do Y’all know how to view your answers to others people questions on your profile? Please answer fast
    14·1 answer
  • For homework, we have to figure out what's in the picture. It's " too close to tell " but I can't figure out what it is. Any ide
    11·1 answer
  • Infrared, a wireless connection used in the past prior to bluetooth, was limited because it ________.
    10·1 answer
  • When was internet created in which year​
    13·2 answers
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle.
    6·2 answers
  • Write a program in qbasic to accept a character and check it is vowel or consonant​
    14·1 answer
  • What is the best resource to learn python?
    14·2 answers
  • 1 pts Question 5 Which of the following calculations would evaluate to 12? (36) + 2/2, 3* ((6+2)/2), 3* 6+2/2, (306+ 2)/2​
    14·1 answer
  • BRIANLIEST!!!!!!!!!!!!!!!!
    12·2 answers
  • Explain the concepts of GIGO—garbage in, garbage out. Why do you think it’s a helpful concept in coding? How do you think it can
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!