# Solving a tricky equation

I'm out of practice with algebra, and I'm having a mind blank on how to solve for $t$ in the following equation. It's for some collision detection if you're wondering. $$\Bigl( \bigl(a-y-(qt)\bigr) \bigl(b-x-(rt)\bigr) \Bigr) - \Bigl( \bigl(c-x-(rt)\bigr) \bigl(d-y-(qt)\bigr) \Bigr) = z$$

I'm really not seeing it at the moment. Thanks for any help.

-
Thanks for the edit. Is there a guide somewhere? I couldn't find one. –  The_Denominater Nov 18 '10 at 4:42
meta.math.stackexchange.com/questions/107/… Learning some basics of LateX allows you to write nicely formatted equations and such. –  yunone Nov 18 '10 at 4:46

You could denote the differences $(a-y)$, $(b-x)$, $(c-x)$, $(d-y)$ as a single symbol to simplify computation. That is, $(a-y)=A$, $(b-x)=B$, $(c-x)=C$, $(d-y)=D$. Then you have

$$(A-qt)(B-rt)-(C-rt)(D-qt)=z$$

So

$$(AB-qBt-rAt+qrt^2)-(CD-rDt-qCt+qrt^2)=z$$

Notice that the $qrt^2$ terms cancel upon distributing the negative, and then you have a linear equation for $t$, so $t$ will be easy to isolate, and then you can resubstitute the values for $A$, $B$, $C$, and $D$. I hope my algebra has been correct.

-
Wow, I'm not really sure what I was thinking. Thanks a lot! –  The_Denominater Nov 18 '10 at 4:34
No problem, and welcome to math.se. –  yunone Nov 18 '10 at 4:40

There is another way to solve it. On the left hand side of equation, there's a useful symmetry.

Separately, there are two things $(a-y-qt)(b-x-rt)$ and $(d-y-qt)(c-x-rt)$. Notice that, you can get the second one by changing the first one: $a$ into $d$, $b$ into $c$.

Let's do it in straight form

$$ab - ax - a(rt) - by + xy + (rt)y - b(qt) + x(qt) + (qt)(rt)$$

$$dc - dx - d(rt) - cy + xy + (rt)y - c(qt) + x(qt) + (qt)(rt)$$

$z=\cdots$

Just continue from here.

-
You should consider using $\LaTeX$ to render those equations well. I'll edit it as an example for you. –  user21436 Dec 25 '11 at 20:38
Thanks. well, I didn't realize this question was asked one year ago before –  snow Dec 25 '11 at 22:09