I am trying to plot the endpoints of the line segment which is a tangent to a circle in Python.
I know the circle has center of (A, B)
, and a radius of r
. The point at which I want to find the tangent at is (a, b)
. I want the tangent to be a segment of length c
. How do I write a code which allows me to restrict the length of the line?
I have the equation of the tangent to be y = (-(B - b)/(A - a))(x - a) + b
. So I know how to plot the two endpoints if the length of the segment did not matter. But how would I determine the x-coordinates of the point? Is there some sort of command which allows me to limit the length of a line?
Thank you!!!