- override
Creates a Expression by adding this member with the argument. Both
members may need to be hoisted to expressions themselves before this can
occur.
For example: (left + right) / cm(2.0) can be used as an Expression
equivalent of the midPointX property.
Source
@override
Expression operator +(EquationMember m) {
if (m is ConstantMember)
return new Expression(new List<Term>.from(terms), constant + m.value);
if (m is Param) {
return new Expression(
new List<Term>.from(terms)..add(new Term(m.variable, 1.0)),
constant
);
}
if (m is Term)
return new Expression(new List<Term>.from(terms)..add(m), constant);
if (m is Expression) {
return new Expression(
new List<Term>.from(terms)..addAll(m.terms),
constant + m.constant
);
}
assert(false);
return null;
}