0

If I have two circles where the center and radius are known, can I solve for all of the points where the edges of those circles are a specific distance apart?

For example:

circle 1:
  center:
    x: 10
    y: 12
  radius: 6

circle 2:
  center:
    x: 14
    y: 16
  radius: 8

How do I find the sets of coordinates for every instance where the distance between the edge of circle 1 and the edge of circle 2 is equal to 4?

JavaScript answers preferred, but if you have a function in another language that works I can try to convert it

TVG
  • 259
  • 3
  • 8
  • This sounds more like a math problem. I suggest figuring out the mathematical equations involved first then implementing it in JavaScript. You probably need to consider at least 4 cases: the circles intersect in two points, the circles intersect in a single point, one circle is contained entirely inside of the other, and on circle is entirely outside the other. – Code-Apprentice Apr 10 '20 at 15:18
  • 1
    I think you can start with this https://stackoverflow.com/q/12219802/1552587 and make it work for you by increasing both circles' radius by 2. – Titus Apr 10 '20 at 15:29
  • @Titus interesting, I already have a circle intersection function so let me see if I can make that work – TVG Apr 10 '20 at 15:48
  • What do you mean by the "edge" of a circle? – EvilTak Apr 10 '20 at 15:56
  • There is infinite number of point pairs with needed distance (if circle positions are close enough) – MBo Apr 10 '20 at 18:19
  • This helped: https://stackoverflow.com/questions/61140525/how-to-infer-the-possible-values-for-the-final-two-coordinates-of-a-trapezoid-wh/61144029?noredirect=1#comment108173638_61144029 – TVG Apr 10 '20 at 19:49

0 Answers0