I have something like this:
If $A > B$, then $X = A - B$, else $X = B - A$.
$X$ and $B$ are known to me, but $A$ is not known to me. Now I have $C$ (which is to basically replace $B$ in the above conditional equation). I want to get $Y$,
If $A > C$, then $Y = A - C$, else $Y = C - A$.
How can I solve for $Y$?
What I have tried so far is that I have rewritten $X^2 = (A - B)^2$ and expanded it and tried to somehow come to $(C-A)^2 = Y^2$, but I had no luck.
Can anyone help? I'm not sure if this is solvable or not. If not, then can anyone explain why?
Assume $X \geq 0$, then
$$X = |A-B| \iff X^2 = (A-B)^2 \iff A^2 -2AB + B^2-X^2=0$$
Now solve the quadratic equation with the classical formula $A=\frac{-b \pm \sqrt{\Delta}}{2a}$ with $a=1, b = -2B, c=B^2-X^2$.