klyn.math.geometry.Vector3d.normalize
method
public normalize() as Vector3d<Double>
Description

Returns a unit vector with the same direction. Finite components are scaled before the length is computed, so very large or subnormal inputs retain their direction without overflow.

Returns

Normalized vector.

Throws
  • ZeroDivisionException If the vector has zero length.
Example
unit = Vector3d<Double>(1.0, 2.0, 2.0).normalize()