vec_normalize(3)

NAME
vec_normalize, vec_normalize2d - normalize a vector

SYNOPSIS
#include <matvec.h>

void vec_normalize (const float *v, float *r);
void vec_normalize2d (const float *v, float *r);

DESCRIPTION

These two functions normalize respectively a 3D or 2D vector v. The original vector v is not touched, and the result is placed in vector r.

To normalize a vector in-place (ie. modifying the original vector), do:

vec_normalize (v, v);

AUTHOR
Richard Jones <rich@annexia.org>

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

VERSION
c2lib-1.2.14

SEE ALSO
vec_magnitude(3), vec_magnitude2d(3).