vec2-fn
    Preparing search index...

    Function multiply

    • Multiply two vectors.

      Type Parameters

      Parameters

      • target: T

        The target vector.

      • value: number | Vec2Param

        The vector to multiply by.

      Returns T

      • A reference to the modified target object.

      Error - When a computed component is NaN or non-finite.

      multiply({ x: 2, y: 3 }, 2); // -> { x: 4, y: 6 }
      
    • Multiply two vectors.

      Type Parameters

      Parameters

      • target: Vec2Param

        The target vector.

      • value: number | Vec2Param

        The vector to multiply by.

      • dest: D

        Destination object to store the result.

      Returns D

      • A reference to the modified destination object.

      Error - When a computed component is NaN or non-finite.

      const result = { x: 0, y: 0 };
      multiply({ x: 2, y: 3 }, 2, result); // result -> { x: 4, y: 6 }