dot method

double dot(
  1. Point other
)

Returns the dot product with another point.

Implementation

double dot(Point other) {
  return x * other.x + y * other.y;
}