Given a line with first end point P(x1,y1) another end point is unknown, intersect with a circle that located at origin with radius R at only one point(tangent) T(x2,y2). An
It is not obvious to me that this is homework, but I do like the intuition that a right triangle is defined. Even so, there will be some algebra with that solution.
Another approach that seems viable is to simply define the problem as the solution of two equations in two unknowns. That is, the equation of a circle, centered at (0,0), with radius R is
x^2 + y^2 = R^2
The equation of a line that passes through the point (xt,yt), with (unknown) slope S is
(y - yt) = S*(x - xt)
Solve the system of two equations for the intersection point. Depending upon the value of S, there will be zero, one or two solutions to this pair of equations. It will also turn out that there are two values of S such that the solution is unique. Solve for those two values of S that make the solution unique, then recover the intersection point (xt,yt). I won't go through the actual solution in depth in case this is homework, but that part is trivial algebra.
My point is that this algebraic approach is another way to view the solution of the computational geometry problem. It highlights an interesting point in that there are two lines which intersect the circle at a tangent point, and that when a line intersects at a tangent point, there is a single point of intersection.
A flaw of this approach is that is fails due to a singularity for SOME problems. I.e., when the line with slope S is vertical, then S is undefined. Other approaches that rely on simple distances and the Pythagorean theorem are robust to that event.