Function rotate

  • Rotate a 2D vector

    Parameters

    • a: Vec2

      The vec2 point to rotate

    • b: Vec2

      The origin of the rotation

    • rad: number

      The angle of rotation in radians

    • Optional dst: Vec2

    Returns Vec2

    the rotated vector