Skip to main content
GameDev.net gamedev.net
🔒 Locked

confusing algebra

Started by staticVoid2 Dec 3, 2008 at 7:34 PM 3 replies 1k views
Original Post
staticVoid2
staticVoid2
ok, I've started a problem with two equations with two unknows but somehow I have got trapped. I started with these two equations:

x1 + ua(x2 - x1) = x3 + ub(x4 - x3)

y1 + ua(y2 - y1) = y3 + ub(y4 - y3)
I then isolated the ub unknown:


y1 - y3 + ua(y2 - y1)
---------------------   = ub
      y4 - y3


x1 - x3 + ua(x2 - x1)
---------------------   = ub
      x4 - x3

then I found the common denominator for each equation:


(y1 - y3)(x4 - x3) + ua(y2 - y1)(x4 - x3)
-----------------------------------------
           (y4 - y3)(x4 - x3)

(x1 - x3)(y4 - y3) + ua(x2 - x1)(y4 - y3)
-----------------------------------------
           (x4 - x3)(y4 - y3)

then subtracted them to give:


(y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3) + ua(y2 - y1)(x4 - x3) - ua(x2 - x1)(y4 - y3)
----------------------------------------------------------------------------------  = 0
                 (y4 - y3)(x4 - x3)

then I separated the addition and got rid of the denominator to give me:


(y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3) =   - ua(y2 - y1)(x4 - x3) + ua(x2 - x1)(y4 - y3)

but I think I've done something wrong somewhere, the correct answer should be:


(x4 - x3)(y1 - y3) - (y4 - y3)(x1 - x3)
---------------------------------------
(y4 - y3)(x2 - x1) - (x4 - x3)(y2 - y1)

can anyone tell me where I went wrong?
apatriarca
apatriarca
If you solve your equation by ua you will obtain:

(x4 - x3)(y1 - y3) - (y4 - y3)(x1 - x3)

--------------------------------------- = ua

(y4 - y3)(x2 - x1) - (x4 - x3)(y2 - y1)
staticVoid2
staticVoid2
do you know where I went wrong in my attempt?
Perost
Perost
Quote:
Original post by staticVoid2
....
then I separated the addition and got rid of the denominator to give me:

(y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3) =   - ua(y2 - y1)(x4 - x3) + ua(x2 - x1)(y4 - y3)

can anyone tell me where I went wrong?


If you take that equation and isolate ua you get:
(y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3) = ua(-(y2 - y1)(x4 - x3) + (x2 - x1)(y4 - y3)) <=>(y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3) = ua((x2 - x1)(y4 - y3) - (y2 - y1)(x4 - x3)) <=> (y1 - y3)(x4 - x3) - (x1 - x3)(y4 - y3)----------------------------------------- = ua (x2 - x1)(y4 - y3) - (y2 - y1)(x4 - x3)

Since the order of multiplication doesn't matter you can move around the terms a bit to get:
 (x4 - x3)(y1 - y3) - (y4 - y3)(x1 - x3)----------------------------------------- = ua (y4 - y3)(x2 - x1) - (x4 - x3)(y2 - y1)

So you've done nothing wrong, you just didn't go all the way.
grhodes_at_work
grhodes_at_work
Closing thread. School problems are a violation of forum policy.

Forum FAQ
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.