operator * method

dynamic operator * (dynamic arg)

Returns a new vector or matrix by multiplying this with arg.

Implementation

dynamic operator *(dynamic arg) {
  if (arg is double) {
    return scaled(arg);
  }
  if (arg is Vector2) {
    return transformed(arg);
  }
  if (arg is Matrix2) {
    return multiplied(arg);
  }
  throw new ArgumentError(arg);
}