operator * method

Point<T> operator * (
  1. 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<double> objects by an int factor. Because the * operator always returns the same type of Point as it is called on, passing in a double factor on a Point<int> causes a runtime error.

Implementation

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

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