# Quad equation for collision detection?

• 06-09-2006
joeprogrammer
For collision detection in my game, if I know a point (p) lies on plane (pl), I can find the collision point easily. However, I need to know if (p) resides in a given quad. I googled, and it seems that I need to use the quadratic formula (or the quad equation). Is this correct? If so, then I am a little bit confused. Consider:

ax2 + bx + c = 0

So does that mean that a, b, and c are the quad vertices? Where does d come in? I know that if the quad is a rectangle, then d would not be necessary. But quad does not imply that it's rectangular. And I would guess that x is a point that would satisfy the equation, right?

So if I used the quad formula, and if I am correct with everything so far, all I would have to do is check for an inequality, and that would decide if a point is on a quad?

Thanks
• 06-09-2006
VirtualAce
a,b, c form the plane and d is the distance.

Using the quadratic formula for what you want to do would be quite slow. There are other ways to accomplish this.

I'll let Bob respond first before I throw my two cents in.