code: function normalize(vec3) {
      if (vec3.x === 0 && vec3.y === 0 && vec3.z === 0) {
          return vec3;
      }
      const length = Math.sqrt(vec3.x * vec3.x + vec3.y * vec3.y + vec3.z * vec3.z);
      const invScalar = 1 / length;
      vec3.x *= invScalar;
      vec3.y *= invScalar;
      vec3.z *= invScalar;
      return vec3;
  }
docs: normalise to unit vector