constrain-system by SICP
implement basic mathematics:
- addition
- subtraction
- multiplication
- division
- square
- sqrt
and multivariate equation
Use functional expression to represent
9C = 5(F-32)
like this:
C, F := Variable("c"), Variable("f")
Multiplication(
Params(Constant(9), C), // left
Params(Constant(5),Addition(Params(Intermediate()), Params(F, Constant(-32))).GetIntermediate())) // right
)
tips:
expr.GetVariable("a") // can't get variable in superior expr when target variable in inferior expr,
but can predefined the variable and then inject into expr