public Variable SetVariable(string name, double value) { Variable v; if (constants.TryGetValue(name,out v)) { if (v.stringValue != null) { throw new ESParameterTypeChangedException("Can not change type of existing parameter " + name); } v.value = value; return v; } v = new Variable(name,value); constants.Add(name,v); return v; }
// private float a = 0f; float fx(float s, float t) { // return (1.25f+0.5f*Mathf.Cos(s))*Mathf.Cos(t); // return Mathf.Cos(s); // var exp = solver.SymbolicateExpression(sfx,new string[]{"s", "t", "a"}); fxexp.SetVariable("t", t); fxexp.SetVariable("s", s); fxexp.SetVariable("a", a); return((float)fxexp.Evaluate()); // return s; }