add method

GPoint add(
  1. GPoint point
)

Adds the coordinates of another point to the coordinates of this point and returns the result as a new point.

For instance, if this point is (2, 3) and the other point is (1, 4), the resulting point will be (3, 7).

Implementation

GPoint add(GPoint point) {
  return GPoint(x + point.x, y + point.y);
}