How to construct a circle tangent to another circle and a line? How to construct a circle tangent to another circle and a line? Also Find locus of centres of all such circles?

 A: You can always rotate and translate the scene so as, e.g., to bring the line to be coincident with the $x$ axis and the circle of radius $R$ to have its center on the $y$ axis, $C=(0,h)$, as in this sketch.
 
Consider then a point $C'=(x,y)$. For this to be the center of a circle tangent to the $x$ axis, the circle shall have radius $y$. Then for this circle to be tangent to the given one, the segment $CTC'$ shall be of length $y+R$.
The rect triangle $\triangle CC'H$ then gives
$$
x^2+(h-y)^2=(y+R)^2
$$
which is a vertical parabola.  
If you want to remain in a general reference scheme (with the circle and the line placed in whichever position and orientation) than you shall find first the segment of minimum distance between $C$ and the line (which is the equivalent of the segment $CO$ in the sketch), and then you can use the same construction: can you do that ?
A: To answer the question about how to construct the required circle: let us exclude the trivial case where the line joining the centres of the circles is perpendicular to the given line.
Let the centre of the given circle be $O$ and the given line be $L$. Pick any point $P$ on the circle so that $OP$ is not perpendicular to $L$.
Draw the line $OP$ and extend it. Construct the perpendicular through $P$ which will be a tangent to the circle. Let this line meet $L$ at point $X$.
Now construct the angle bisector at $X$ which bisects the angle between $PX$ and $L$ so that it meets the line $OP$ at $C$.
Now $C$ is the centre of the required circle which will touch the original circle at $P$ and will also have $L$ as tangent.
As far as the locus of the centre of $C$ is concerned, construct a line parallel to $L$ on the other side from the original circle, and at a distance from $L$ equal to the radius of the original circle.
The point $C$ then satisfies the focus-directrix property of the parabola with this new line as the directrix and the centre of the original circle as the focus.
So the locus is a parabola.
A: Take point A on the circumference of the given circle with center O, join OA and let the tangent at A intersect with the given straight line at B.  On the given straight line make BC = BA. Let the perpendicular at C meet radius OA extended at D, and join BD.  Then since $\triangle ABD$ and $\triangle CBD$ have AB = BC, $\angle BAD = \angle BCD$, and BD in common, the triangles are congruent, and AD = CD.  Therefore a circle drawn with center D and radius DA will touch the given circle at A and the given straight line at C.  If A is the point closest to the line, the tangent at A will not intersect, but a circle touching the given circle and line is easily drawn, since its center is the midpoint of the extension of radius OA to the line.  The only point excluded is the point on the given circle which is farthest from the given line: its tangent does not intersect the given line, and no circle, however great its radius, can be tangent both to the given line and to the given circle at this point. What is the locus of the centers of the infinite number of circle solutions?  Every center is equidistant from the given straight line and circle.  If we replace the circle with a point, we know the locus is a parabola.  But even with a circle, as we go outward on the locus, radius DA approaches equality with DO, the distance of the point on the locus to point O, since DA and DO are growing beyond all bounds while OA remains fixed.  Thus it seems whatever the size of the given circle, the locus is indistinguishable from a parabola the farther out on it you go.  In fact, if we extend DC to E, such that CE = OA, and draw EF parallel to BC, then since CE = CA, it's clear the locus is exactly a parabola with focus O and directrix EF.   
A: The basic equation the point needs to satisfy is that :-
$$d(\textbf x,\textbf c) = \pm d(\textbf x, L) + r$$
Where $L$ represents the line, and $C(\textbf c, r)$ represents the circle.
Here, $d(\textbf a, \textbf b) = ||\textbf a - \textbf b||$
