2

I've found a related question, which helped me get started on this. I can get it to work for the example on the question, but I'm running into an issue when the tangent is not y = 0.

Other question is here: How to Determine an Equation of a Circle using a Line and Two Points on a Circle

Sorry I can't post a picture as I don't have enough reputation.. One can be found at http://www.chucara.dk/images/Voronoi3.png

My question is: Given two points P1:$(10,10)$ and P2:$(20,20)$ and a tangent of $y = 40$, what is the center of the circle O:$(a,b)$ that has both points on its circumference and has the line as a tangent.

I've tried reducing my problem by simply subtracting the tangent from the points' $y$ coordinate and using the example in the other post with points $(10,-30)$ and $(20, -20)$.

This gives me a normal of $y = -x-10$

I using the pythagoran theorem and the equation of the normal, I get to the quadratic equation:

$0 = x^2 - 80x + 400$

I solve this, and get two solutions (rounded): $x = 5.36$ and $x = 74.64$

In turn, giving me: $(5.36, 24.64)$ and $(74.64, -44.64)$

However, this doesn't seem right. Can anyone tell me where I've gone wrong in my calculations? Or how would you solve it?

Just to give a bit of background, I'm trying to implement this in C#, so I need a general solution. This is what is causing my headaches.

  • Thanks for the edit Micah. I'm new to the forum. – Troels Larsen May 05 '13 at 21:59
  • If you think of a tangent at $y=0$ and say points on the circumference at $(-10, 10)$ and $(10, 10)$ you'll see that all you can say is that the center is on the half line $(0, y)$ with $y \ge 10$. Your problem is underdetermined. – vonbrand May 05 '13 at 23:33
  • @vonbrand: That's not true. There are two solutions, but the conditions do constrain the centre more than just to a half line. – joriki May 06 '13 at 05:29

1 Answers1

3

You haven't made a mistake. Here's an image of your arrangement. There are two solutions. The red line is the line from P1 to P2. The two tangent points are indeed measured as your solved x values.

enter image description here

Mark Ping
  • 401
  • 3
  • 8
  • 1
    Upon further calculation, I can see you're right. I shall endeavor to stop coding/doing math after midnight in the future. – Troels Larsen May 06 '13 at 15:02