# Dot and Vector product

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

## Recommended Posts

What are the dot and vector cross product used for in terms of games programming? I think the vector product can be used to discover if an AI character can see a player, is that right? How does that work (if its right)?

##### Share on other sites
Asking a question like that is like asking what nuts and bolts are used for. The applications are, without further constraints, too endless to list and there is no clear starting point to even start listing.

With a dot product you can find out the angle between two vectors. Or project a vector onto another. Or calculate the distance of a point from line or plane in Hessian normal form.
With a cross product you can calculate a vector standing perpendicular on two others. Or calculate the area of a parallelogram.
With both together you can calculate the determinant of a 3x3 matrix.

##### Share on other sites
Apologies. I should have said i was just looking for a few examples of where it is used most, or its most important uses, not every one. Cheers

##### Share on other sites
That does not really help either. ;)

If you have the up and forward vector of a camera you can calculate the right vector with the cross product. Essential in some games. Completely unneeded in others. And so on.

It would be much easier to ask "how can I solve problem XYZ with vector algebra". If you just want to know if learning vector algebra is useful: most likely yes.

1. 1
2. 2
3. 3
4. 4
5. 5
Rutin
18

• 11
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631420
• Total Posts
2999990
×