vec_dot_product

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION
SEE ALSO

NAME

vec_dot_product - calculate the dot product of two vectors

SYNOPSIS

#include <matvec.h>

float vec_dot_product (const float *v1, const float *v2);

DESCRIPTION

vec_dot_product calculates the dot product of two vectors v1 and v2 and returns it. The dot product is formally defined as:
|v1| |v2| cos theta
where theta is the angle between the two vectors.
One interesting consequence of this is that if both v1 and v2 are already normalized, then the dot product is 1 if the vectors are parallel and running in the same direction, and 0 if the vectors are perpendicular.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

c2lib-1.2.13

SEE ALSO

vec_magnitude_in_direction(3), vec_angle_between(3)