operator - method

Point<T> operator -(
  1. Point<T> other
)

Subtract other from this, as if both points were vectors.

Returns the resulting "vector" as a Point.

Example:

var point = const Point(10, 100) - const Point(10, 10); // Point(0, 90)
point = const Point(-10, -20) - const Point(100, 100); // Point(-110, -120)

Implementation

Point<T> operator -(Point<T> other) {
  return Point<T>((x - other.x) as T, (y - other.y) as T);
}