vec_magnitude_in_direction - calculate relative direction of two vectors |
#include <matvec.h> float vec_magnitude_in_direction (const float *v1, const float *v2); |
If v1 and v2 are parallel and point in the same direction, then vec_magnitude_in_direction returns +1. If v1 and v2 are perpendicular, this returns 0. If v1 and v2 are parallel and point in opposite directions to each other, this returns -1. For other vectors, this function returns the cosine of the angle between the vectors. |
Richard Jones <rich@annexia.org> |
GNU LGPL (see http://www.gnu.org/) |
c2lib-1.2.13 |
vec_dot_product(3), vec_angle_between(3) |