Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or intersect. The
Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or intersect. 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) + (y1 - y2)). Three conditions arise: 1. If d -- r1+r2 Circles touch each other. 2. If d > r1+r2 Circles do not touch each other. 3. If d
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started