Finding circle with two points on it and a tangent from one of the points Two points P1(x1,y1) and P2(x2,y2) are known. In addition, a line slope passing through P1 is known. The aim is to construct a circle (or circular arc) that it passes through both P1 and P2 and it is tangent to the line. How can we find the center of the circle and the radius with those given information? (2 points and 1 tangent)
As it can be seen in the figure, the radius and the center (in green) are unknown and aim is to find the center point and radius (or curvature)

 A: The line from the centre to P1 is perpendicular to the given line; and the centre is equidistant from P1 and P2.  That gives you two lines that the centre must lie on.
Let the given line be $ax+by=c$.  If you just have its slope $m$, you can take $a=-m$ and $b=1$.  (And $c=ax_1+by_1$, but we're not going to use that.)  A perpendicular line has the form $bx-ay = \text{something}$, and the something can be determined by using the fact that the line is supposed to go through P1.  Thus our first line is
$$ bx - ay = bx_1 - ay_1 \tag{1} $$
The line through P1 and P2 is
$$ (y_1-y_2)x - (x_1-x_2)y = x_2y_1 - x_1y_2 $$
A perpendicular line has the form
$$ (x_1-x_2)x + (y_1-y_2)y = \text{something} $$
and the something can be determined by the fact that we want the line to go through the midpoint of P1P2, that is, $(\frac12(x_1+x_2),\frac12(y_1+y_2))$.  Thus our second line is
$$ (x_1-x_2)x + (y_1-y_2)y = \tfrac12(x_1^2+y_1^2-x_2^2-y_2^2) \tag{2} $$
The equations (1) and (2) together form a linear system which can be solved by standard methods, e.g., Cramer's rule.  The solution is the centre of the desired circle, and the radius, if needed, is the distance from that point to P1.
