EDIT (ANWSER IS FOUND): Thanks to everybody providing anwsers. After the initial anwser provided my chronos I realized that I only have to calculate the point where the 2 tangent lines on the circle cross (waypoint) and then the distance from that point to the aircraft.
The solution was eventually rather simple:
Distance = Radius * Tan(Angledifference / 2);
ORIGINAL QUESTION
Hello everybody,
Sorry for making this long post with what may be a very foolish question but I tried to work it out for several hours now and the solution is not coming to me :D)
Im currently making an Air Traffic Controller game and I need some help. A part of this game will be that aircraft automatically proceed to a waypoint and follow a given track after this point. But I cannot manage to figure out the math.
I included a picture to make more clear what I mean. My goal is to calculate the distance to the waypoint where the aircraft should start its turn to end exactly at the given track after the waypoint.
In situation 1 the aircraft is coming from north (on heading 180 / south), and it will turn left to a heading of 090 (east). To end at this line it should start its turn when the distance is equal to the turnradius of the aircraft. The circle is representing the turnradius.
In situation 2 the aircraft is on heading 135 (south-east) and it will intercept the same track)
From trial and error I found out that Y = (1 - Cos(headingdifference or angle)) * radius.
But the problem is I can only use Y if the intercepting track is 090 or 270. So I need to calculate the distance to the waypoint (A) to make it work for every heading.
Thank you very much in advance to anyone who is nice enough to invest his time in this math-idiot.

I think you are looking for the power of a point. I won't do all the math because it might get rather messy, but the basic idea is you need to draw the tangent circle with given radius to the track you're on and the one you want to end on.
You already know radius, you only need to compute now $s$, i.e., the distance to $A$, which will be a function on $\theta$, the angle both tracks form. When the distance from the plane to $A$ is the power of A, prepare to turn!