# Dot Product

Node Description & Purpose:
The Dot product takes the Input and Input 2 vectors and outputs the dot product of the two vectors, which is a value. The dot product is the cosine of the angle between the two vectors multiplied by the lengths of the two vectors.

The dot product is useful because it can tell us about the relationship between two vectors. If the dot product equals 0 then the two vectors are at 90º to each other (perpendicular). If the dot product is greater than 0 then two vectors are pointing roughly in the same direction. If the dot product is less than 0 then the two vectors are pointing away from each other.

The dot product is even more useful when the two vectors are unit vectors. In that case the dot product is the cosine of the angle between the two vectors. You can also get the cosine of the angles between non-unit vectors using the following formula:

`cosine = Dot product( vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. 1, vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. 2 ) ÷ ( Length( vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. 1 ) x Length( vectorA vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank. 2 ) )`

The cosine value will range between 1 and -1. If the two vectors are pointing in the same direction the value will be 1. If they're at right angles to each other the value will be 0. If one is pointing in exactly the opposite direction to the other (i.e. 180º to the other ) the value will be -1.

To find the actual angle between the vectors in degrees you can do this:

`angle in degrees = Radians to degrees( Arccos( cosine ) )`

Node Type: Function

Settings:
This has just the one setting, which lets you choose a for Input 2.