Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.

share|cite|improve this question
Thanks for the edit Micah. I'm new to the forum. – Troels Larsen May 5 '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 5 '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 6 '13 at 5:29
up vote 2 down vote accepted

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

share|cite|improve this answer
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 6 '13 at 15:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.