Results 1 to 2 of 2
Thread: overlap radius... help me..
 08212010, 09:04 PM #1Member
 Join Date
 Aug 2010
 Posts
 2
 Rep Power
 0
overlap radius... help me..
Write a program that prompts the user to enter the center coordinates and radius of two circles and determines whether the second circle is inside the first or overlaps with the first.
Hint: circle2 is inside circle1 if the distances between the two centers
<=r1 – r2
circle2 overlaps circle1 if the distance between the two centers
<=r1 + r2
So i have found the correct formula but dont know how to write the coding. Can someone help me....
circle2 is inside circle1 if:
distance(x1,y1,x2,y2) <= Math.abs(r1r2)
circle2 overlaps circle1 if:
distance(x1,y1,x2,y2) <= Math.abs(r1+r2

The secret to success here is to break your problem down into small steps, and then attack each step one at a time. A great resource that can help you get started is this link: So, You Need to Write a Program but Don't Know How to Start
Since we don't know where your stuck, it's difficult to help you. Just stating that you don't know how to write the code again leaves us with the option of referring you to the tutorials, and that's about it. You know of course that no one here is going to write this for you. Please have a look at the link above, and then try to do as much as you can to solve your problem. You probably can do more than you think you can. Then if you get stuck you can post your attempt, and we'll know how to help you.
Best of luck!
Similar Threads

coordinates and radius
By tepong in forum New To JavaReplies: 1Last Post: 08212010, 07:38 PM 
[SOLVED] Best way to overlap Images?
By Krooger in forum AWT / SwingReplies: 3Last Post: 06082009, 07:12 PM 
java program help. find the radius of a circle
By megironi in forum New To JavaReplies: 1Last Post: 03272009, 08:09 AM
Bookmarks