* Creates a Cartesian2 instance from x and y coordinates. * * @param {number} x The x coordinate. * @param {number} y The y coordinate. * @param {Cartesian2} [result] The object onto which to store the result. * @returns {Cartesian2} The modified result parameter or a new Cartesian2 i
(x, y, result)
| 46 | * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. |
| 47 | */ |
| 48 | static fromElements(x, y, result) { |
| 49 | if (!defined(result)) { |
| 50 | return new Cartesian2(x, y); |
| 51 | } |
| 52 | |
| 53 | result.x = x; |
| 54 | result.y = y; |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Duplicates a Cartesian2 instance. |
no test coverage detected