operator * method

  1. @override
CustomPoint<T> operator *(
  1. num factor
)
override

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

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