Function vec2

Creates a 2D vector.

  • Parameters

    • x: number = 0

      The x-coordinate of the vector.

    • Optionaly: number

      The y-coordinate of the vector. If not provided, it will default to the value of x.

    Returns Vector

    A new Vector object representing the 2D vector.