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.