operator - method

Vector3 operator -(
  1. dynamic v
)

Implementation

Vector3 operator -(dynamic v) {
  if (v is num) {
    return Vector3(x - v, y - v, z - v);
  } else if (v is Vector3) {
    return Vector3(x - v.x, y - v.y, z - v.z);
  } else if (v == null) {
    return this * -1;
  } else {
    throw 'Vector3 only support subtraction by num or Vector3';
  }
}