/// <summary> /// </summary> /// <param name="parent"></param> /// <returns></returns> public override string ToString(NuGenFormulaElement parent) { NuGenOperator parentop = parent as NuGenOperator; if (parentop != null && parentop.Preference > 1) return string.Format("({0})", this.ToString()); else return this.ToString(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFunction"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para><paramref name="element"/> is <see langword="null"/>.</para> /// </exception> public NuGenFunction(NuGenFormulaElement element) { if (element == null) { throw new ArgumentNullException("element"); } _element = element; }
/// <summary> /// </summary> /// <param name="parent"></param> /// <returns></returns> public override string ToString(NuGenFormulaElement parent) { NuGenOperator parentop = parent as NuGenOperator; if (parentop != null && parentop.Preference > 1) { return(string.Format("({0})", this.ToString())); } else { return(this.ToString()); } }
/// <summary> /// Initializes a new instance of the <see cref="NuGenOperator"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenOperator(NuGenFormulaElement left, NuGenFormulaElement right) { if (left == null) { throw new ArgumentNullException("left"); } if (right == null) { throw new ArgumentNullException("right"); } _left = left; _right = right; }
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(); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenPower"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenPower(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFac"/> class. /// </summary> /// <param name="element"></param> /// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception> public NuGenFac(NuGenFormulaElement element) : base(element) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenMultiplication"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenMultiplication(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenRemainder"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenRemainder(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenAddition"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenAddition(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSubtraction"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenSubtraction(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// </summary> public virtual string ToString(NuGenFormulaElement parent) { return(this.ToString()); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenAbs"/> class. /// </summary> /// <param name="elem">The elem.</param> public NuGenAbs(NuGenFormulaElement elem) : base(elem) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSin"/> class. /// </summary> /// <param name="element"></param> /// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception> public NuGenSin(NuGenFormulaElement element) : base(element) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenDivision"/> class. /// </summary> /// <param name="left"></param> /// <param name="right"></param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="left"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="right"/> is <see langword="null"/>.</para> /// </exception> public NuGenDivision(NuGenFormulaElement left, NuGenFormulaElement right) : base(left, right) { }
/// <summary> /// Initializes a new instance of the <see cref="NuGenLog"/> class. /// </summary> /// <param name="element"></param> /// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception> public NuGenLog(NuGenFormulaElement element) : base(element) { }
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; }
private float GetVal(NuGenFormulaElement fml, double val) { return Math.Min(1e4f, Math.Max(GetValIS(fml, val), -1e4f)); }
/// <summary> /// </summary> public virtual string ToString(NuGenFormulaElement parent) { return this.ToString(); }