W3cubDocs

/Dart 2

operator * method

Point<T> operator * (num factor)

Scale this point by factor as if it were a vector.

Important Note: This function accepts a num as its argument only so that you can scale Point objects by an int factor. Because the star operator always returns the same type of Point that originally called it, passing in a double factor on a Point<int> causes a runtime error in checked mode.

Implementation

Point<T> operator *(num /*T|int*/ factor) {
  return new Point<T>((x * factor), (y * factor));
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-math/Point/operator_multiply.html