local splitDistanceBounds = {min = math.sqrt(2 - 2 * math.cos(math.rad(settings.allowableAngleBetweenForks.v.min))), max = math.sqrt(2 - 2 * math.cos(math.rad(settings.allowableAngleBetweenForks.v.max)))} --Values between 0 and 2
I know this is not a math class, but I was reading this tree generation code, I made a simple one but was reading code behind an more advanced one... with forks, duel branches ect... But I was confused by the code above... Why Sqrt with cos? i'm not the best with trig..

2 comments
Cos to get the side of a triangle that has not been defined yet, that uses Hypotenuse / Opposite / Adjacent. Using them three things you can make an angle. So if you ever heard of "Law of cosines" that what cos is being used for, and if I do remember right, the sqrt = squared and in the Law of Cosines you need sqrt. The equation goes something like this: a^2 = b^2 + c^2 - 2 b c cos(A) :)
In a nutshell, this looks like some form of a law of cosine operation to create an triangle and find the degree / size of it.