A rather simple/complicated math problem I encountered whilst programming. Here's the simplified version of it:
a+c=e
b=absolute value of(X-R)
C=absolute value of(X-r)
R-r?
a,c,e,b,X,R are all known but r isn't.
Edit
if(x-R>0&&x-r>0) {//x-R is B and x-r is C
int Rminusr=C-B;
}else if(x-R>0&&x-r<0) {
int Rminusr=-C-B;
}else if(x-R<0&&x-r>0) {
int Rminusr=B+C;
}else if(x-R<0&&x-r<0) {
int Rminusr=B-C;
}else if(x-R==0) {
int Rminusr=-r+x;
}else if(x-r==0) {
int Rminusr=R-x;
}
this is what I got until i realized that i dont actually know r or X-r