The calculation is for games so a approximation is better than a computational intense correct calculation. What i need to find is the radius of the given arc.
In this case the "curve" can be thought of a arc as this approximation is good enough. So the situation look like this:
I know:
What i need to know:
Background - Actually i need the radius for two things:
B
with offset of x
from the center arc. So that r of B
would be r + x
What i tried:
I know how to calculate the radius if i have the circumference and the inner angle of the arc. But i am completely stuck with the given information though i am sure it should not be too complicated ..
If you think a triangle with right angle at the middle of the green line and another point at the center of the circle, then the angle at the intersection of the green segments in that triangle is α/2 and the cosine ratio for that angle is
cos(α/2)*r = g/2
g the length of a green segment.
The angle at the top of a pie slice is π-α
so that for the length b
of the blue curve segments you should get
b = (π-α)*r
The radius values you get from both formulas should not differ more than the measurement errors let expect.