/// <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();
		}
示例#2
0
        /// <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;
        }
示例#3
0
		/// <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;
		}
示例#4
0
        /// <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());
            }
        }
示例#5
0
		/// <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;
		}
示例#6
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();
		}
示例#7
0
        /// <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;
        }
示例#8
0
		/// <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)
		{
		}
示例#9
0
 /// <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)
		{
		}
示例#11
0
 /// <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)
 {
 }
示例#12
0
 /// <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)
 {
 }
示例#13
0
		/// <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)
		{
		}
示例#14
0
 /// <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)
 {
 }
示例#15
0
 /// <summary>
 /// </summary>
 public virtual string ToString(NuGenFormulaElement parent)
 {
     return(this.ToString());
 }
示例#16
0
 /// <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)
 {
 }
示例#17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenAbs"/> class.
 /// </summary>
 /// <param name="elem">The elem.</param>
 public NuGenAbs(NuGenFormulaElement elem)
     : base(elem)
 {
 }
示例#18
0
		/// <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)
		{
		}
示例#19
0
 /// <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)
 {
 }
示例#20
0
		/// <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)
		{
		}
示例#21
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;
		}
示例#22
0
		private float GetVal(NuGenFormulaElement fml, double val)
		{
			return Math.Min(1e4f, Math.Max(GetValIS(fml, val), -1e4f));
		}
示例#23
0
 /// <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)
 {
 }
示例#24
0
		/// <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)
		{
		}
示例#25
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenAbs"/> class.
		/// </summary>
		/// <param name="elem">The elem.</param>
		public NuGenAbs(NuGenFormulaElement elem)
			: base(elem)
		{
		}
示例#26
0
		/// <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>
		/// </summary>
		public virtual string ToString(NuGenFormulaElement parent)
		{
			return this.ToString();
		}
示例#28
0
		/// <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)
		{
		}