* Create a 2d vector, can take 1 or 2 scalar values * @param {number} [x] * @param {number} [y] - if y is undefined, x is used for both * @return {Vector2} * @example * let a = vec2(0, 1); // vector with coordinates (0, 1) * a = vec2(5); // set a to (5, 5) * b = vec2(); // set
(x=0, y)
| 587 | * b = vec2(); // set b to (0, 0) |
| 588 | * @memberof Math */ |
| 589 | function vec2(x=0, y) { return new Vector2(x, y ?? x); } |
| 590 | |
| 591 | /** |
| 592 | * Check if object is a valid Vector2 |
no outgoing calls
no test coverage detected