I'm trying to find a formula for the length of intercepts by a circle, of radial lines passing through a point inside a circle. For example, when the point coincides with the center, it would be equal to r, and when the point lies on the circle, the answer is sin(theta).
Is there a general form equation that can apply to the points inside and outside the circle?
Let $P$ be a point at a distance $a$ from center $O$. And let $Q$ be a point on the circle, with $PQ=d$ and $\angle OPQ=\theta$. By the cosine rule applied to triangle POQ we have: $$ r^2=d^2+a^2-2ad\cos\theta. $$ From that you can find $d$: $$ d=a\cos\theta+\sqrt{r^2-a^2\sin^2\theta}, $$ where I chose the sign in front of the square root so that $d=r+a$ for $\theta=0$.