I want to calculate the distance d that moves the beta angled blue line out of unit circle center so that both alpha angles are equal.
Seems not so easy than i initially thought - please help :)
I want to calculate the distance d that moves the beta angled blue line out of unit circle center so that both alpha angles are equal.
Seems not so easy than i initially thought - please help :)
Thx, but that would be only a part of the solution - Initially i have the line at the light blue position and alpha is unknown.
Note that if beta angle becomes larger, there should be more movement in d direction and alpha angle becomes larger too.
If i'd know alpha i could calculate d and vice virsa.
But if beta is 90 deg., any solution for d is correct, but alpha is 90 deg. So asking for alpha would have been wiser than asking for d.
I tried things like sin(alpha) = pow(sin(beta), 2) or sin(alpha) = sqrt(sin(beta))
Both work for 0 and 90 degree case, but not in between.
I'm near a solution, I must verify it and post it, but I won't be at the PC for few hours now so it will probably won't be sooner than in like 4 hours. And it isn't so easy, indeed ;)
So, I ended with a quadratic equation, so there are two solutions, but one of them quite doesn't make sense, but you'll see when you try it (it gives you a negative d so large that the line would be completely out of the circle).
The quadratic equation looks like this:
d^2 * sin(beta) + d * R - R^2 * sin(beta) = 0
where d is your unknown variable, beta is the angle and R is radius of the circle. You said a unit circle so R probably will be 1, but it was better to make it universal I think ;)
The better of the two solutions is:
D = R^2 + 4 * (sin(beta))^2 * R^2
d = (-R + sqrt(D)) / (2 * sin(beta))
Because of one algebraic operation I did in the process, there arose a condition that cos(beta) cannot be zero. Which makes sense, because that's true for beta = 90°.
If you're interested in the whole calculation, let me know and I'll post it somehow.
I tested it a little bit more and it is working as expected.
May I please ask you - next time let us know on the forum when you aren't looking for the solution anymore. It's quite sad when somebody else is spending a good amount of time solving your problem for you, just to find then that you didn't probably even read the thread.