I'm working on a hobby programming project and my mathematic thinking is feeling a bit slow at the moment. Basically, in situations similar to the image I made, given the information I mentioned in the title, I need to be able to calculate the coordinates of the tangent point. (Dimensions are from the origin.) Could you all help me out with finding a straightforward way of doing so? Thanks in advance.

(P.S. In the program, this will actually be in 3D, but once I have the 2D solution I should be able to figure it out in 3D.)

You do not actually need trigonometry. Let $AC = r$ be the radius, let point $A$ be at $(x_1, y_1)$, and point $B$ be at $(x_2, y_2)$. You know the values of $r, x_2$, and $y_2$.
First find the length of $AB$ using Pythagoras. Then using the distance formula (Pythagoras again) and squaring both sides, $(y_2 - y_1)^2 + (x_2 - x_1)^2 = AB^2$.
In addition, $(x_1, y_1)$ must lie on the circle, so $x_1^2 + y_1^2 = r^2$. Solving these two equations will give you $x_1, y_1$ in terms of the other variables. There will be two solutions, but you can plot each of them and determine which one is correct for the general setup.