##### Ninja Library - Matrix Function

# njUnitVector

Converts an arbitrary vector to a unit vector

### FORMAT

`

  Float njUnitVector(*v)
  NJS_VECTOR *v

`

### PARAMETER

  `*v` | Arbitrary vector

### RETURN

  Size of the original vector (scalar)

### DESCRIPTION

  Converts an arbitrary vector to a unit vector.

### EXAMPLE

      The following converts vector v(3, 3, 3) to a unit vector.
      NJS_VECTOR v;
      Float scalar;
      v.x = 3.f;
      v.y = 3.f;
      v.z = 3.f;
      scalar = njUnitVector(&v)
      % Result %
      v(0.577350, 0.577350, 0.577350)
      scalar = 5.196152

njUnitVector

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999