You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vestride_Shuffle/src/point.js

24 lines
438 B
JavaScript

import getNumber from './get-number';
/**
* Represents a coordinate pair.
* @param {number} [x=0] X.
* @param {number} [y=0] Y.
*/
const Point = function (x, y) {
this.x = getNumber(x);
this.y = getNumber(y);
};
/**
* Whether two points are equal.
* @param {Point} a Point A.
* @param {Point} b Point B.
* @return {boolean}
*/
Point.equals = function (a, b) {
return a.x === b.x && a.y === b.y;
};
export default Point;