How to solve $x\cos(t)+y\sin(t)=1$ for $t$ When trying to find the points, $P_1$ and $P_2$, on a circle of radius $R$ such that the tangent line to those points passes through the point $P_0$, it was all simple geometry until I ran into $x\cos(t)+y\sin(t)=1$.
I found other questions solving the same circle problem, but they went about it in a different way so never ran into this expression.
Plugging into wolfram alpha gives $2\tan^{-1}(\frac{y+\sqrt{y^2+x^2-R^2}}{R+x})$ which works in practice here https://www.desmos.com/calculator/y8sz3kwjki, but I have no idea how it arrived at that solution. I assume there must be answers somewhere, but I couldn't find them for some reason.

Hint
This is a well known problem. Divide everything by $\sqrt{x^2+y^2}$ and get
$$\frac{x}{\sqrt{x^2+y^2}}\cos(t)+\frac{y}{\sqrt{x^2+y^2}}\sin(t)=\frac{1}{\sqrt{x^2+y^2}}$$
Can you see the  trigonometric meaning of $\frac{x}{\sqrt{x^2+y^2}}$ and $\frac{y}{\sqrt{x^2+y^2}}$?
For instance, make $\sin (a)=\frac{x}{\sqrt{x^2+y^2}}$, what happen now?
