Pular para o conteúdo principal

Vetor3.normalize()

Método de instância em Vector3.

Descrição

  • Retorna a normalizado copy of this Vector3 (comprimento equals 1). |

Method Signature

normalize()

Mathematical Definition

\hat{v}=v/||v||

Parameters

  • None.

Retorna

  • Vector3: returned by overloads of this method.

Mutability

  • Does not modify o atual vector unless explicitly using a Local/Equal variant.

Edge Cases

  • Normalizing a zero-comprimento vector is mathematically undefined.
  • Implementations may return zero, unchanged value, or NaN components.
  • Very small magnitudes can create unstable normalizado directions.

Usage Example

Vector3 direction = target.getPosition().subtract(myTransform.getPosition()).normalize();
myTransform.setPosition(myTransform.getPosition().add(direction.multiply(speed)));

Mathematical Example

Example input/output depends on overload; for vector arithmetic operations this is typically computed per-component.

Visualization