Exemplo n.º 1
0
 private NuGenFormula(string formel, NuGenPlotInterval intervall, Color frb, bool draw, NuGenFormula[] children, double param)
 {
     _formel   = formel;
     _children = new NuGenFormulaCollectionBase();
     if (children != null)
     {
         _children.AddRange(children);
     }
     this._param          = param;
     this._formulaElement = NuGenInterpreter.ParseInfixExpression(formel);
     this._interval       = intervall;
     this.frb             = frb;
     this._paintValidate  = new NuGenPlotInterval(0.0, 0.0);
     this.draw            = draw;
     _pth       = new GraphicsPath();
     _pthasympt = new GraphicsPath();
 }
Exemplo n.º 2
0
        private float GetValIS(NuGenFormulaElement fml, double val)
        {
            NuGenInterpreter.SetVariableValue(_varx, val);
            float res = (float)fml.Value;

            if (float.IsNaN(res))
            {
                return(0f);
            }
            else if (float.IsPositiveInfinity(res))
            {
                return(2e30f);
            }
            else if (float.IsNegativeInfinity(res))
            {
                return(-2e30f);
            }
            else
            {
                return(res);
            }
        }
Exemplo n.º 3
0
 private float GetVal(NuGenFormulaElement fml, double val)
 {
     return(Math.Min(1e4f, Math.Max(GetValIS(fml, val), -1e4f)));
 }