operator * method

  1. @override
CustomPoint<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.


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