I tried using a raycasting-style function to do it but can’t get any maintainable results. I’m trying to calculate the intersection between two tangents on one circle. This picture should help explain:

I’ve googled + searched stackoverflow about this problem but can’t find anything similar to this problem. Any help?
Well, if your variables are:
The lines from the circle center to the two points
AandBareCA = A - CandCB = B - Crespectively.You know that a tangent is perpendicular to the line from the center. In 2D, to get a line perpendicular to a vector
(x, y)you just take(y, -x)(or(-y, x))So your two (parametric) tangent lines are:
Then to calculate the intersection of two lines you just need to use standard intersection tests.