[Math] How to calculate the distance between two lines drawn at separate angles

anglegeometry

I don't know much about math, so forgive me if this is an obvious / unnecessary question. Please feel free to point me towards any resource that might enlighten me. However I need to know this for a game I'm interested in developing.

Here's what I'm wondering: If two lines are drawn at different angles but emerge from the same point, is there some constant for calculating how far apart those lines have become at some point along those lines?

I've drawn a dot to represent 90 degrees. I've drawn two lines from that point, one at 80 degrees and the other at 60 degrees. I know that after 5.2mm on the 60-degree line, and 4.9mm on the 80-degree, the two lines are 12mm apart.

What I can't figure out is how to use that information to calculate the how far away the lines will be at some other theoretical point along one of them. I feel like that there's some simple exponent for this, but I can't figure this out.

Any help would be appreciated. Thanks.

Best Answer

What you need is the cosine rule . $\cos p = \frac{a^2+b^2-c^2}{2ab}$, where b is the side opposite to the angle p. Which gives you, $c = \sqrt{x^2+y^2-2xy\cos 20}$ = "distance" between the two lines for your case. Here, x and y are the distances along the two lines. For further help with the cosine rule: https://en.wikipedia.org/wiki/Law_of_cosines