Remember algebra?

Miscellaneous Forums/General Discussion/Remember algebra?

OK, let's have one of you bright-eyed college kids remind me how this is done.
X1 = 512 + X * 44 - Y * 44
X1 is a value I know.

solve for X, I get:                      solve for Y, I get:

X1 - 512 = X * 44 - Y * 44              X1 - 512 = X * 44 - Y * 44

X1 - 512                                X1 - 512
-------- = X - Y            <-right?->  -------- = X - Y
   44                                      44

X1 - 512                                -(X1-512)
-------- + Y = X              right?->  --------- + X = Y
   44                                      44
Problem is, although I know the value of X1, I don't know the value of X or Y, since I'm trying to solve for both of them.
As you can see, I need one to solve the other. I can't remember if there's a way to solve them at the same time.
Any help would be appreciated.

Given that you have 2 unknown variables and only one linear equation, can't be solved, you have infinities of solutions.

Well, would it help to also know this then?
Y1 = 678 - Y * 28 - X * 28

Y1 - 678 = -Y * 28 - X * 28   Y1 - 678 = -Y * 28 - X * 28

Y1 - 678                      Y1 - 678
-------- = -Y - X             -------- = -Y - X
   28                            28

-(Y1-678)                     -(Y1-678)
--------- - Y = X             --------- - X = Y
   28                             28
Can these formulas somehow be combined with the above formulas to come up with a solution? Again, I only know X1 and Y1. X and Y are the same variables in all formulas.

Ha! I figured it out. Combining the two formulas lead to this:
X = ((X1-512)/44-(Y1-678)/28)/2
and
Y = (-(X1-512)/44-(Y1-678)/28)/2
See, if X =
    X1 - 512
X = -------- + Y
       44
and Y (from the second posts equations) =
    -(Y1-678)
Y = --------- - X
        28
then if the second equation is substituted for Y in the first, you get
    X1 - 512   -(Y1-678)
X = -------- + --------- - X
       44          28
which then becomes
     X1 - 512   -(Y1-678)
2X = -------- + ---------
        44          28
and then
    X1 - 512   -(Y1-678)
X = -------- + ---------
       44          28
    --------------------
              2
which is the solution. The solution for Y was similar.

I can't believe I still remember how to do all this crap.

on your first post I would have done this:

(X1-512)
--------- - X = Y
44


as in used - X and not making the top half -ve, not sure if both end ways up the same or not. Actually, they don't I just plugged some simple numbers in, so you may have gone wrong there. [edit] scratch that, I forgot that Y should be -Y on the otherside, and thus reverse all the signs you get what you did, fine.

btw on your final solution can't you remove the massive /2 under it all by halfing the other denominators?

Don't remember. I may try that.

Nope, that made it quadruple. But doubling the denominators did work. Thanks for helping simplify the equation.

no probs, well one less divide might gain a few ms over 1000s of iterations ;-)