Given a line, L and two points, A & B not on the line, construct a circle which contains both points and is tangent to
the given line.
The lines AB and L intersect at a fixed point P.
The circle we search has centre at O . and the line L is tangent to this circle at the point Q.
According to a well known theorem of the Euclidean Geometry (PA) X (PB) = (PQ)^2 therefore PQ =SQRROOT[(PA) X (PB)]
this expression defines the position of the point of tangency Q along the line L . The centre of the circle is the intersection point O of the perpendicular bisector of AB and the perpendicular line to the line L at Q. OA =OB =OQ = r is the radius of the circle .
MINOAS
The original question contains a mistake.
What if your point is between $\displaystyle A~\&~B$, that is $\displaystyle A-P-B~?$ If so the no such circle exists.
So it must be stated that $\displaystyle A~\&~B$ are on the same side of $\displaystyle \ell$.
But then it may be that $\displaystyle \overleftrightarrow {AB} \cap \ell = \emptyset$, parallel. In which case $\displaystyle P$ does not exist.