I've created the following equation that represents a relation-ship among points:
x = d/(d-sin(a)*w) * cos(a)*w
I want to know the angle (a) that satisfies the relation. I got the following result from WolframAlpha:
(1)
a = 2*atan(w*x + sqrt(d^2+w^2-d^2*x^2+w^2*x^2) / d*(w+x) );
OR
(2)
a = 2*atan(w*x - sqrt(d^2+w^2-d^2*x^2+w^2*x^2) / d*(w+x) );
Notice the different in the sign, it's because during the operations it took the square root from both sides to eliminate squares and that operation added the absolute value to one side.
Does anyone have a better idea? OR A simple way to detect which equation to use?