RPE Chart Utils
    Preparing search index...

    Function vec2Normalize

    • Normalize a vector to unit length (magnitude = 1). Returns the zero vector if the input magnitude is effectively zero.

      Parameters

      Returns Vec2

      vec2Normalize(vec2(3, 4)); // { x: 0.6, y: 0.8 }
      vec2Normalize(vec2(0, 0)); // { x: 0, y: 0 }