vec_dot (VECTOR* vector1, VECTOR* vector2);

Returns the dot product of the two vectors. The dot product is the cosine of the angle between the two vectors multiplied with the product of their lengths.

Parameters:

vector1 - first vector.
vector2 - second vector.

Returns:

Dot product

Speed:

Fast

Example:

angle = acos(vec_dot(v1,v2)/(vec_length(v1)*vec_length(v2))); // calculate the angle between two vectors

See also:

Vectors, vec_add, vec_sub, vec_scale, vec_set, vec_inverse, vec_diff, vec_cross

► latest version online