Spec-Zone.ru › Dart 2

dart:math

Оператор - метод

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

Вычитает other из this, как если бы обе точки были векторами.

Возвращает полученный "вектор" как Point.

Пример:

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

Реализация

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

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-math/Point/operator_minus.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API