Dot product of two trinomials

Cosmo Kramer

New member
Joined
Dec 14, 2020
Messages
2
Hi,
In the expressions below "A" is the origin vector, "t" is a constant, "b" is the direction vector and "C" is the sphere center vector, "r^2" - sphere's radius squared and "⋅" is (afaik) a dot product operation.

It's about testing if a 3D point is inside a sphere:
(P - C) ⋅ (P - C) = r^2
"P" is the point, "C" - sphere's center. However "P" is really a ray defined by P(t) = A + tb, so:
(A + tb - C) ⋅ (A + tb - C) = r^2
And at this point I'm stuck because I don't understand how it got expanded to:
t^2b ⋅ b + 2tb ⋅ (A - C) + (A - C) ⋅ (A - C) - r^2 = 0
because I've seen a dot product of two binomials but never of trinomials.
 
Hi,
In the expressions below "A" is the origin vector, "t" is a constant, "b" is the direction vector and "C" is the sphere center vector, "r^2" - sphere's radius squared and "⋅" is (afaik) a dot product operation.

It's about testing if a 3D point is inside a sphere:
(P - C) ⋅ (P - C) = r^2
"P" is the point, "C" - sphere's center. However "P" is really a ray defined by P(t) = A + tb, so:
(A + tb - C) ⋅ (A + tb - C) = r^2
And at this point I'm stuck because I don't understand how it got expanded to:
t^2b ⋅ b + 2tb ⋅ (A - C) + (A - C) ⋅ (A - C) - r^2 = 0
because I've seen a dot product of two binomials but never of trinomials.
First, this seems to test whether P lies on the sphere, not inside it.

Second, you should be familiar with multiplying trinomials from algebra; there is nothing essentially different.

But you will probably find this easier to follow if you first rewrite

(A + tb - C) ⋅ (A + tb - C) = r^2​

as

((A - C) + tb) ⋅ ((A - C) + tb) = r^2​

and expand that.
 
Thanks, yeah "on", and starting off by grouping (A - C) helped a lot.
(A - C) ⋅ (A - C) + 2(A - C) ⋅ tb + tb ⋅ tb
then using the formula (a + b) ⋅ (a + b) = a ⋅ a + 2a ⋅ b + b ⋅ b I got:
t^2b ⋅ b + 2(A - C) ⋅ tb + (A - C) ⋅ (A - C)
t^2b ⋅ b + 2tb ⋅ (A - C) + (A - C) ⋅ (A - C)

I would have never come up with this on my own.
For me it's difficult because I graduated school 20+ years ago and had nothing to do with math since then and we probably didn't learn the dot product.
I can of course do just usual multiplication but I can't be sure I'm not misunderstanding something because there isn't a compiler telling me I'm doing something wrong like in programming.
 
I would have never come up with this on my own.
In this case, since we were not trying to do by ourselves whatever they are headed toward in this work (I don't even know what that is), but just to understand what they are doing, we have the privilege of looking ahead. That can be a powerful advantage (not only here, but, say, in doing proofs where you know the goal). I saw what they were doing by observing that in their result, A and C appear only in the form (A - C). So they must have grouped them together ...

Reading people's minds is a good skill to have!
 
Top