class Point { constructor(x, y) { this.my_x = x this.my_y = y } get x() { return this.my_x } get y() { return this.my_y } get coordinates() { return [this.my_x, this.my_y] } multiplyWith([[a11, a12], [a21, a22]]) { return new Point(a11 * this.my_x + a21 * this.my_y, a12 * this.my_x + a22 * this.my_y) } translateBy(offset) { return new Point(this.my_x + offset.x, this.my_y + offset.y) } }