# how did he do that ?

This topic is 1457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Iv'e read an article about collision dectection , and there was one thing I did not understand :

from this

to this :

how did he do that ?

##### Share on other sites

To echo the guy above me: often times you can solve collision detection problems by writing down functions and solving them, but that usually gives nothing back to the developer in terms of geometric intuition. Sometimes the geometric approach can lead to simpler or alternative (optimized) solutions.

##### Share on other sites

how did he do that ?

I'm with you.  I hate it when I'm using an algorithm that I don't understand.  I have run into many stumbling blocks in the "Real Time Rendering" equations where there are giant leaps in math without any explanation.  I like to know how they got from A to B.  It is of no use when you're just coding, but when you are trying to lean how someone came up with the algorithm, giant leaps in math with no explanation doesn't help.

##### Share on other sites

That's a linear system with ua and ub as variables. You can solve it in different ways and reach the same expression or an equivalent one.

In this case it looks like it's solved using the Cramer's rule: http://mathworld.wolfram.com/CramersRule.html

I guess it doesn't really matter the step by step solution, it won't make much difference to your programming knowledge. If you're learning about collision detection don't waste too much time on stuff like that, there are much more usefull concepts involved.

To echo the guy above me: often times you can solve collision detection problems by writing down functions and solving them, but that usually gives nothing back to the developer in terms of geometric intuition. Sometimes the geometric approach can lead to simpler or alternative (optimized) solutions.

how did he do that ?

I'm with you.  I hate it when I'm using an algorithm that I don't understand.  I have run into many stumbling blocks in the "Real Time Rendering" equations where there are giant leaps in math without any explanation.  I like to know how they got from A to B.  It is of no use when you're just coding, but when you are trying to lean how someone came up with the algorithm, giant leaps in math with no explanation doesn't help.

I really need to understand this for implementing something similar

##### Share on other sites

But are you going to implement the middle steps too?

Try applying the Cramer's rule and you'll probably get that same result, in that link I quoted there's a step by step description of the method.

If you want a simpler to understand method that doesn't involve determinants and works for 2 equations, try this:

1. Isolate ua form the first equation and replacing it into the second one.
2. With that new equation you should be able to get the ub value on the book or some equivalent expression.
3. Knowing ub replace it into the first equation and you can get obtain the value of ua (or, again, an equivalent expression).

That method uses less concepts, but you can easily mess up with all those coeficients.

Edited by DiegoSLTS

##### Share on other sites

That method uses less concepts, but you can easily mess up with all those coeficients.

I started this on my whiteboard.  Yuck.  Stick with the above suggestions!

##### Share on other sites

If the book's primary concern is not teaching math, I think that step is perfectly fine. It is not trying to teach you how to solve a linear system of equations, it's just solving one. You can learn about how you solve systems of equations elsewhere, and then you can check that you get the same result.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011384
• ### Who's Online (See full list)

There are no registered users currently online

×