operator * method

dynamic operator *(
  1. dynamic arg
)

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

Implementation

@pragma('wasm:prefer-inline')
@pragma('vm:prefer-inline')
@pragma('dart2js:prefer-inline')
dynamic operator *(dynamic arg) {
  final Object result;
  if (arg is double) {
    result = scaled(arg);
  } else if (arg is Vector2) {
    result = transformed(arg);
  } else if (arg is Matrix2) {
    result = multiplied(arg);
  } else {
    throw ArgumentError(arg);
  }
  return result;
}