• Post Reply Bookmark Topic Watch Topic
  • New Topic

Touching or Intersecting circles  RSS feed

 
Kirstie Fran
Ranch Hand
Posts: 33
Android Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a program that will have to determine if two circle touch; and if two other circles touch.
I have my code set up to retrieve the values necessary for this exercise and have been able to output them for data verification. I just need some help with my formulas.
I would like to use a few simple Boolean expressions to determine these facts.

 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do YOU know how to do it? I don't me write java code, I mean work it out with paper and pencil, using algebra. That is the first step.
 
Kirstie Fran
Ranch Hand
Posts: 33
Android Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, i have found a few explanaitions online, but they are fairly involved, and i'm not sure if i can convert it all into coharent code.

http://mathworld.wolfram.com/Circle-CircleIntersection.html
 
Ryan Sykes
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what level of algebra you are comfortable with, but you are unnecessarily complicating things by looking at the link you posted (everything in there is of course correct, but a lot of the calculations are for things you do not care about for your intersection or touching methods). Forget about algebra even, just think visually. If you had two circles in front of you, at what point do they touch? What happens when they start intersecting? Can you relate that to any geometric parameters?

If you've ever used a drafting compass, this would be even easier to grasp. Take some time and think about it. Don't rush head first into writing the code without having a clear idea of what you need to do and what the logic for the program/method is going to be.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!