Autocad option
One option would be to do it through a 3 point circle.
First select the two points and then use the tangent snap to select the third point on the line.
Finding the snap location algebraically
Assuming:
- $(x1,y1)$ : the coordinates of the 1st point (P1)
- $(x2,y2)$ : the coordinates of the 2nd point (P2)
- the tangent is horizontal (for simplicity)
- $(xs, 0) $ the snap point is with coordinates (to simplify the equation otherwise its too long).
The way I'd go about it is the following:
- Find the middle point between the two points and its coordinates $(x_m,y_m)$.
$$ \left(\frac{x1 + x2}{2}, \frac{y1 + y2}{2}\right)$$
- Write out the equation for the line perpendicular to the line connecting the two points
$$ y_{12,perp} =\frac{y1+y2}{2}-\frac{x2-x1 }{y2-y1}\left(x+\frac{1}{2} (-x1-x2)\right)$$
- Find the equation for the line perpendicular to the Line (the one you want to be tangent), with one parameter changing (e.g the $x_L$ if its horizontal).
$$xT = xC$$
In this particular step because of assumptions 3 and 4 the this equation is a lot simpler. Otherwise it would have looked very much like equation from step 2, but with points P3 and P4 belonging to the tangent. I thought it better to do it this way, because the final equation is almost unusable otherwise.
- Then assume a point in space ($x_c,y_c$). For that point to be the center it should be in equal distance from point 1 ($x_1,y_1$), 2 ($x_1,y_1$), and the point tangent to the equation. For this subset you will only have 2 unknowns ($x_c,y_c$) - because the snap point coincides with the center $xc$.
In this case you have the following equations that need to be solved:
$$\begin{cases}
\sqrt{(xc-x1)^2+(yc-y1)^2}=yc\\
yc=\frac{y1+y2}{2}-\frac{(x2-x1) \left(\frac{1}{2} (-x1-x2)+xc\right)}{y2-y1}
\end{cases}
$$
Solving the above system results in:
$$ xc = \frac{1}{2 x2-2 x1}\left(\frac{x1^2 y1^2}{y1^2-2 y1 y2+y2^2}-\frac{x1^2 y2^2}{y1^2-2 y1
y2+y2^2}-x1^2+\frac{2 y1 \sqrt{x1^4 y1 y2-4 x1^3 x2 y1 y2+6 x1^2 x2^2
y1 y2+x1^2 y1^3 y2-2 x1^2 y1^2 y2^2+x1^2 y1 y2^3-4 x1 x2^3 y1
y2-2 x1 x2 y1^3 y2+4 x1 x2 y1^2 y2^2-2 x1 x2 y1 y2^3+x2^4
y1 y2+x2^2 y1^3 y2-2 x2^2 y1^2 y2^2+x2^2 y1 y2^3}}{y1^2-2 y1
y2+y2^2}-\frac{2 y2 \sqrt{x1^4 y1 y2-4 x1^3 x2 y1 y2+6 x1^2 x2^2 y1
y2+x1^2 y1^3 y2-2 x1^2 y1^2 y2^2+x1^2 y1 y2^3-4 x1 x2^3 y1 y2-2
x1 x2 y1^3 y2+4 x1 x2 y1^2 y2^2-2 x1 x2 y1 y2^3+x2^4 y1
y2+x2^2 y1^3 y2-2 x2^2 y1^2 y2^2+x2^2 y1 y2^3}}{y1^2-2 y1
y2+y2^2}-\frac{2 x1 x2 y1^2}{y1^2-2 y1 y2+y2^2}+\frac{2 x1 x2
y2^2}{y1^2-2 y1 y2+y2^2}+\frac{x2^2 y1^2}{y1^2-2 y1 y2+y2^2}-\frac{x2^2
y2^2}{y1^2-2 y1 y2+y2^2}+x2^2-\frac{y2^4}{y1^2-2 y1 y2+y2^2}+\frac{2 y1
y2^3}{y1^2-2 y1 y2+y2^2}-y1^2+\frac{y1^4}{y1^2-2 y1 y2+y2^2}-\frac{2 y1^3
y2}{y1^2-2 y1 y2+y2^2}+y2^2\right)
$$
or a much friendlier form
$$\small{xc= -\frac{\sqrt{y1 y2 (x1-x2)^2 \left(x1^2-2 x1 x2+x2^2+(y1-y2)^2\right)}+x1^2 y2-x1 x2 (y1+y2)+x2^2 y1}{(x1-x2) (y1-y2)}}$$
or
$$\small{xc =
\frac{\sqrt{ {y1} {y2} ( {x1}- {x2})^2 \left( {x1}^2-2 {x1} {x2}+ {x2}^2+( {y1}- {y2})^2\right)}+ {x1}^2
(- {y2})+ {x1} {x2} {y1}+ {x1} {x2} {y2}- {x2}^2 {y1}}{( {x1}- {x2}) ( {y1}- {y2})}}$$
You can select one of them using the constraints from the other point.
you can easily extend the idea to a more generic tangent.