normalizeWithLength Method

Return a normalized instance and instance length.

normalizeWithLength(result?: Vector3d): { mag: number, v: undefined | Vector3d }

@returns object containing the properties:

  • v: unit vector in the direction of the instance, or undefined if mag is near zero
  • mag: length of the instance prior to normalization
Parameter Type Description
result Vector3d optional pre-allocated object to return as v property

Returns - { mag: number, v: undefined | Vector3d }

object containing the properties:

  • v: unit vector in the direction of the instance, or undefined if mag is near zero
  • mag: length of the instance prior to normalization

Defined in

Last Updated: 17 December, 2024