• Adds a scalar value to a 2D vector in the direction specified by the given angle.

    Parameters

    • value: number

      The scalar value to be added to the vector.

    • angle: number

      The angle in radians that determines the direction of the addition.

    • vec: Position2D

      The initial 2D vector represented by an object with x and y coordinates.

    Returns Position2D

    • The new 2D vector after adding the scalar value in the specified direction.