What exactly is dot product and what do people typically use it for?

So, I’m reverse-engineering a script and I’m seeing a lot of the :Dot() method around here and I have no idea what it’s for or what it’s doing. I’ve tried searching up stuff online but have only come up with “movement vector something something force vector” which I still don’t understand.

Was hoping I could get some insight from here before I spend another hour looking for more vector math stuff.

The Ultimate Guide to Vector3:Cross() and Vector3:Dot() - Resources / Community Tutorials - DevForum | Roblox

2 Likes

Heh, forum search is pretty bugged. This did not come up when I searched for it. Thanks!

Google works for searching devforum

Just to add onto the other post, which explains it very nicely and simply in a practical and useful way but doesnt go into too much detail into exactly what dot is in a mathematical sense:

The really confusing math definition of dot product is:
“The distance along one vector at which a line extended perpendicularly to the vector at that position will intersect with the other vectors tip”

Its much better explained by a visual:

You usually start with two vectors, one with a length of 1 (or a unit vector)

Then you just follow the definition: find a line perpendicular to one vector which also intersects the tip of the other

gif

gif

You can see how the definition now fits in

The distance along the blue vector


The purple line, perpendicular to the blue line intersecting with the tip of the red vector at that distance


The line intersects the red vectors tip

I think the other post explains pretty nicely the different uses of dot product, but just to sum it up basically its a way to do certain trig stuff in 3D without knowing certain things like angles, lengths, etc
Its very epic and has countless uses, but its one of those things where you just have to be creative with it

6 Likes